From ce03b02a79f43adbbb9d4a4513233fb9cc89d7bf Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 8 Oct 2015 21:21:44 -0400 Subject: [PATCH] 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 --- libs/pbd/crossthread.posix.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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) {