diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | glib/glibmm/main.cc | 9 |
2 files changed, 11 insertions, 4 deletions
@@ -1,3 +1,9 @@ +2004-07-23 Martin Schulze <mschulze@cvs.gnome.org> + + * glib/glibmm/main.cc: Move deletion of SourceConnectionNode object + into destroy_notify_callback() exclusively; do not delete from notify(). + (bug #144420) + 2004-07-10 Murray Cumming <murrayc@murrayc.com> * glib/glibmm/signalproxy_connectionnode.cc: notify(): Do not delete diff --git a/glib/glibmm/main.cc b/glib/glibmm/main.cc index 26b26bca..41dd351a 100644 --- a/glib/glibmm/main.cc +++ b/glib/glibmm/main.cc @@ -62,14 +62,16 @@ void* SourceConnectionNode::notify(void* data) { SourceConnectionNode *const self = static_cast<SourceConnectionNode*>(data); - // if there is no object, this call was triggered from destroy_notify_handler(). + // if there is no object, this call was triggered from destroy_notify_handler(), + // because we set self->source_ to 0 there: if (self->source_) { GSource* s = self->source_; self->source_ = 0; g_source_destroy(s); - delete self; + // Destroying the object triggers execution of destroy_notify_handler(), + // eiter immediately or later, so we leave that to do the deletion. } return 0; @@ -80,8 +82,7 @@ void SourceConnectionNode::destroy_notify_callback(void* data) { SourceConnectionNode *const self = static_cast<SourceConnectionNode*>(data); - // if there is no object, this call was triggered from notify(). - if (self->source_) + if (self) { // The GLib side is disconnected now, thus the GSource* is no longer valid. self->source_ = 0; |