summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2015-10-08 21:21:44 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2015-10-08 21:55:37 -0400
commitce03b02a79f43adbbb9d4a4513233fb9cc89d7bf (patch)
tree5c351fe86391a51dd881588c9ec295369a2a79ab
parentfcc759588255e8bc5ff5c9bf2b01bf3ab65c627e (diff)
in a CrossThread object, ensure destruction of the channel and source used on Posix
The source holds a reference to the channel; both must be unref'ed/destroyed in order to fully clean up resources
-rw-r--r--libs/pbd/crossthread.posix.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/libs/pbd/crossthread.posix.cc b/libs/pbd/crossthread.posix.cc
index e3f6df5a31..72a4fad810 100644
--- a/libs/pbd/crossthread.posix.cc
+++ b/libs/pbd/crossthread.posix.cc
@@ -2,6 +2,7 @@
CrossThreadChannel::CrossThreadChannel (bool non_blocking)
: receive_channel (0)
+ , receive_source (0)
{
fds[0] = -1;
fds[1] = -1;
@@ -28,8 +29,14 @@ CrossThreadChannel::CrossThreadChannel (bool non_blocking)
CrossThreadChannel::~CrossThreadChannel ()
{
- if (receive_channel) {
+ if (receive_source) {
+ g_source_destroy (receive_source);
+ receive_source = 0;
+ }
+
+ if (receive_channel) {
g_io_channel_unref (receive_channel);
+ receive_channel = 0;
}
if (fds[0] >= 0) {