a-EQ: Revert one of the previous changes
[ardour.git] / libs / pbd / crossthread.win.cc
index 5eca5fb4e8daa70ebe6c01230488bbafd2a4a136..60572bde705d75ec080f28addd5cceef8fe51bfe 100644 (file)
@@ -89,6 +89,14 @@ CrossThreadChannel::CrossThreadChannel (bool non_blocking)
 
 CrossThreadChannel::~CrossThreadChannel ()
 {
+       if (receive_source) {
+               /* this disconnects it from any main context it was attached in
+                  in ::attach(), this prevent its callback from being invoked
+                  after the destructor has finished.
+               */
+               g_source_destroy (receive_source);
+       }
+
        /* glibmm hack */
 
        if (receive_channel) {