From: buliabyak Date: Sat, 22 Aug 2009 02:21:36 +0000 (+0000) Subject: fix 416940 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=ba58c6992ab1da64a22e1179efa429bfdffba957;p=inkscape.git fix 416940 --- diff --git a/src/widgets/gradient-vector.cpp b/src/widgets/gradient-vector.cpp index ba31470f6..c884604a2 100644 --- a/src/widgets/gradient-vector.cpp +++ b/src/widgets/gradient-vector.cpp @@ -1084,10 +1084,18 @@ sp_gradient_vector_widget_destroy (GtkObject *object, gpointer /*data*/) gradient = (GObject*)g_object_get_data (G_OBJECT (object), "gradient"); - if (gradient && SP_OBJECT_REPR(gradient)) { - /* Remove signals connected to us */ - /* fixme: may use _connect_while_alive as well */ + sigc::connection *release_connection = (sigc::connection *)g_object_get_data(G_OBJECT(object), "gradient_release_connection"); + sigc::connection *modified_connection = (sigc::connection *)g_object_get_data(G_OBJECT(object), "gradient_modified_connection"); + + if (gradient) { + g_assert( release_connection != NULL ); + g_assert( modified_connection != NULL ); + release_connection->disconnect(); + modified_connection->disconnect(); sp_signal_disconnect_by_data (gradient, object); + } + + if (gradient && SP_OBJECT_REPR(gradient)) { sp_repr_remove_listener_by_data (SP_OBJECT_REPR(gradient), object); } }