Browse Source

Dont assume python pipe write is always successful

tags/v1.9.9
falkTX FilipeCSnuk 6 years ago
parent
commit
a0e5dd5cec
2 changed files with 8 additions and 6 deletions
  1. +7
    -4
      source/externalui.py
  2. +1
    -2
      source/native-plugins/resources/carla-plugin

+ 7
- 4
source/externalui.py View File

@@ -181,8 +181,9 @@ class ExternalUI(object):

def send(self, lines):
if self.fPipeClient is None or len(lines) == 0:
return
return False

hasError = False
gCarla.utils.pipe_client_lock(self.fPipeClient)

try:
@@ -199,9 +200,11 @@ class ExternalUI(object):
line2 = "%.10f" % line
else:
print("unknown data type to send:", type(line))
return
return False

gCarla.utils.pipe_client_write_msg(self.fPipeClient, line2 + "\n")
if not gCarla.utils.pipe_client_write_msg(self.fPipeClient, line2 + "\n"):
hasError = True
break

finally:
gCarla.utils.pipe_client_flush_and_unlock(self.fPipeClient)
return gCarla.utils.pipe_client_flush_and_unlock(self.fPipeClient) and not hasError

+ 1
- 2
source/native-plugins/resources/carla-plugin View File

@@ -60,8 +60,7 @@ class PluginHost(CarlaHostQtPlugin):
if self.fExternalUI is None:
return False

self.fExternalUI.send(lines)
return True
return self.fExternalUI.send(lines)

# -------------------------------------------------------------------



Loading…
Cancel
Save