diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2009-12-09 18:37:06 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2009-12-09 18:37:06 +0000 |
commit | b8b55ef0036bbef9a2961f03f44387ea8c89456a (patch) | |
tree | 47bead791023bd5efab6306ebcfea101f48688a7 /libs/pbd/pbd/crossthread.h | |
parent | c38e02285fda1fd7966c9e4ad85994445247e6a6 (diff) |
OSC is now driven by an event loop; fix up lifetime mgmt of Glib::Source to workaround bug in Glib
git-svn-id: svn://localhost/ardour2/branches/3.0@6329 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/pbd/pbd/crossthread.h')
-rw-r--r-- | libs/pbd/pbd/crossthread.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/libs/pbd/pbd/crossthread.h b/libs/pbd/pbd/crossthread.h index f2fb4aa469..7a323e198f 100644 --- a/libs/pbd/pbd/crossthread.h +++ b/libs/pbd/pbd/crossthread.h @@ -33,11 +33,21 @@ class CrossThreadChannel { void drain (); static void drain (int fd); + /* glibmm 2.22 and earlier has a terrifying bug that will + cause crashes whenever a Source is removed from + a MainContext (including the destruction of the MainContext), + because the Source is destroyed "out from under the nose of" + the RefPtr. I (Paul) have fixed this (https://bugzilla.gnome.org/show_bug.cgi?id=561885) + but in the meantime, we need a hack to get around the issue. + */ + Glib::RefPtr<Glib::IOSource> ios(); + void drop_ios (); + bool ok() const { return fds[0] >= 0 && fds[1] >= 0; } private: - Glib::RefPtr<Glib::IOSource> _ios; // lazily constructed + Glib::RefPtr<Glib::IOSource>* _ios; // lazily constructed int fds[2]; }; |