diff options
author | Martin Schulze <mschulze@cvs.gnome.org> | 2004-08-01 16:16:44 +0000 |
---|---|---|
committer | Martin Schulze <mschulze@src.gnome.org> | 2004-08-01 16:16:44 +0000 |
commit | f9730106d76bc6f803affdbb23a48f3ef9a4f2d1 (patch) | |
tree | 759a826f99cc6b19a49b22a0ab19b66baacc21eb | |
parent | c07890fdd698363e8b43ae0bf390d8c053fa390e (diff) | |
download | glibmm-f9730106d76bc6f803affdbb23a48f3ef9a4f2d1.tar.gz |
Move deletion of SourceConnectionNode object into
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)
-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; |