From 6789e8158675229b9644f31befc27e683311fef6 Mon Sep 17 00:00:00 2001 From: buliabyak Date: Mon, 2 Jul 2007 19:04:27 +0000 Subject: [PATCH] fix wrong modified signal handling: connecting was sigc but disconnecting was old g_signal --- src/sp-filter.cpp | 14 ++++++++------ src/sp-filter.h | 1 + 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/sp-filter.cpp b/src/sp-filter.cpp index 11aa30e0b..aae143e8d 100644 --- a/src/sp-filter.cpp +++ b/src/sp-filter.cpp @@ -111,6 +111,8 @@ sp_filter_init(SPFilter *filter) filter->_renderer = NULL; filter->_image_name = map(); + + new (&filter->modified_connection) sigc::connection(); } /** @@ -156,14 +158,14 @@ sp_filter_release(SPObject *object) //release href if (filter->href) { - if (filter->href->getObject()) { - sp_signal_disconnect_by_data(filter->href->getObject(), filter); - } + filter->modified_connection.disconnect(); filter->href->detach(); delete filter->href; filter->href = NULL; } + filter->modified_connection.~connection(); + if (((SPObjectClass *) filter_parent_class)->release) ((SPObjectClass *) filter_parent_class)->release(object); } @@ -352,13 +354,13 @@ static void filter_ref_changed(SPObject *old_ref, SPObject *ref, SPFilter *filter) { if (old_ref) { - sp_signal_disconnect_by_data(old_ref, filter); + filter->modified_connection.disconnect(); } if ( SP_IS_FILTER(ref) && ref != filter ) { - ref->connectModified(sigc::bind(sigc::ptr_fun(&filter_ref_modified), filter)); - //g_signal_connect(G_OBJECT(ref), "modified", G_CALLBACK(filter_ref_modified), filter); + filter->modified_connection = + ref->connectModified(sigc::bind(sigc::ptr_fun(&filter_ref_modified), filter)); } filter_ref_modified(ref, 0, filter); diff --git a/src/sp-filter.h b/src/sp-filter.h index c6edc6c65..9c4e7aaf6 100644 --- a/src/sp-filter.h +++ b/src/sp-filter.h @@ -56,6 +56,7 @@ struct SPFilter : public SPObject { NumberOptNumber filterRes; /** HREF attribute */ SPFilterReference *href; + sigc::connection modified_connection; NR::Filter *_renderer; -- 2.30.2