summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Schulze <mschulze@cvs.gnome.org>2004-08-01 16:16:44 +0000
committerMartin Schulze <mschulze@src.gnome.org>2004-08-01 16:16:44 +0000
commitf9730106d76bc6f803affdbb23a48f3ef9a4f2d1 (patch)
tree759a826f99cc6b19a49b22a0ab19b66baacc21eb
parentc07890fdd698363e8b43ae0bf390d8c053fa390e (diff)
downloadglibmm-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--ChangeLog6
-rw-r--r--glib/glibmm/main.cc9
2 files changed, 11 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 1421e0cc..6f91e8b4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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;