]> git.sur5r.net Git - glabels/commitdiff
Disconnect callbacks that reference the properties dialog when it is destroyed.
authorJim Evins <evins@snaught.com>
Sat, 30 Nov 2002 00:11:31 +0000 (00:11 +0000)
committerJim Evins <evins@snaught.com>
Sat, 30 Nov 2002 00:11:31 +0000 (00:11 +0000)
git-svn-id: https://glabels.svn.sourceforge.net/svnroot/glabels/trunk@193 f5e0f49d-192f-0410-a22d-a8d8700d0965

glabels2/src/view-barcode.c
glabels2/src/view-box.c
glabels2/src/view-ellipse.c
glabels2/src/view-image.c
glabels2/src/view-line.c
glabels2/src/view-text.c

index 400208530cfd500a17453c823eca6d00c7513fb9..70048b9143ae143801c99e642a1fcfda8f6b69ee 100644 (file)
@@ -375,6 +375,8 @@ response_cb (GtkDialog     *dialog,
             gint          response,
             glViewBarcode   *view_barcode)
 {
+       glLabelObject *object;
+
        gl_debug (DEBUG_VIEW, "START");
 
        g_return_if_fail(dialog != NULL);
@@ -385,6 +387,13 @@ response_cb (GtkDialog     *dialog,
                gtk_widget_hide (GTK_WIDGET(dialog));
                break;
        case GTK_RESPONSE_DELETE_EVENT:
+               /* Dialog destroyed, remove callbacks that reference it. */
+               object = gl_view_object_get_object (GL_VIEW_OBJECT(view_barcode));
+
+               g_signal_handlers_disconnect_by_func (object, update_dialog_cb,
+                                                     view_barcode);
+               g_signal_handlers_disconnect_by_func (object, update_dialog_from_move_cb,
+                                                     view_barcode);
                break;
        default:
                g_print ("response = %d", response);
index d4a6469339770f7d9109d6236d2ad29132acf25b..3f0215ad6d9ea2189c89ce242e40ba350c629bf9 100644 (file)
@@ -385,17 +385,28 @@ response_cb (GtkDialog *dialog,
             gint      response,
             glViewBox *view_box)
 {
+       glLabelObject *object;
+
        gl_debug (DEBUG_VIEW, "START");
 
        g_return_if_fail(dialog != NULL);
        g_return_if_fail(GTK_IS_DIALOG(dialog));
 
        switch(response) {
+
        case GTK_RESPONSE_CLOSE:
                gtk_widget_hide (GTK_WIDGET(dialog));
                break;
+
        case GTK_RESPONSE_DELETE_EVENT:
+               /* Dialog destroyed, remove callbacks that reference it. */
+               object = gl_view_object_get_object (GL_VIEW_OBJECT(view_box));
+
+               g_signal_handlers_disconnect_by_func (object, update_dialog_cb, view_box);
+               g_signal_handlers_disconnect_by_func (object, update_dialog_from_move_cb,
+                                                     view_box);
                break;
+
        default:
                g_print ("response = %d", response);
                g_assert_not_reached ();
index 36d4fcc20786b40e12b50f96e8303165005c2758..00e1f18b8e725099c4ac927dd6d3f9d5badf141d 100644 (file)
@@ -386,6 +386,8 @@ response_cb (GtkDialog     *dialog,
             gint          response,
             glViewEllipse *view_ellipse)
 {
+       glLabelObject *object;
+
        gl_debug (DEBUG_VIEW, "START");
 
        g_return_if_fail(dialog != NULL);
@@ -396,6 +398,13 @@ response_cb (GtkDialog     *dialog,
                gtk_widget_hide (GTK_WIDGET(dialog));
                break;
        case GTK_RESPONSE_DELETE_EVENT:
+               /* Dialog destroyed, remove callbacks that reference it. */
+               object = gl_view_object_get_object (GL_VIEW_OBJECT(view_ellipse));
+
+               g_signal_handlers_disconnect_by_func (object, update_dialog_cb,
+                                                     view_ellipse);
+               g_signal_handlers_disconnect_by_func (object, update_dialog_from_move_cb,
+                                                     view_ellipse);
                break;
        default:
                g_print ("response = %d", response);
index 05073e1ad6511086a1ee6176b023f75884164506..e4f17c70dbfccf2cc8a353998b78c37c707dff6f 100644 (file)
@@ -384,6 +384,8 @@ response_cb (GtkDialog     *dialog,
             gint           response,
             glViewImage   *view_image)
 {
+       glLabelObject *object;
+
        gl_debug (DEBUG_VIEW, "START");
 
        g_return_if_fail(dialog != NULL);
@@ -394,6 +396,13 @@ response_cb (GtkDialog     *dialog,
                gtk_widget_hide (GTK_WIDGET(dialog));
                break;
        case GTK_RESPONSE_DELETE_EVENT:
+               /* Dialog destroyed, remove callbacks that reference it. */
+               object = gl_view_object_get_object (GL_VIEW_OBJECT(view_image));
+
+               g_signal_handlers_disconnect_by_func (object, update_dialog_cb,
+                                                     view_image);
+               g_signal_handlers_disconnect_by_func (object, update_dialog_from_move_cb,
+                                                     view_image);
                break;
        default:
                g_print ("response = %d", response);
index 7d4d8588a0f960158f5811f95d60b28a425ff5ad..0bf83e449fc67bb460d50ef17dda6f45205ee599 100644 (file)
@@ -370,6 +370,8 @@ response_cb (GtkDialog     *dialog,
             gint          response,
             glViewLine    *view_line)
 {
+       glLabelObject *object;
+
        gl_debug (DEBUG_VIEW, "START");
 
        g_return_if_fail(dialog != NULL);
@@ -380,6 +382,13 @@ response_cb (GtkDialog     *dialog,
                gtk_widget_hide (GTK_WIDGET(dialog));
                break;
        case GTK_RESPONSE_DELETE_EVENT:
+               /* Dialog destroyed, remove callbacks that reference it. */
+               object = gl_view_object_get_object (GL_VIEW_OBJECT(view_line));
+
+               g_signal_handlers_disconnect_by_func (object, update_dialog_cb,
+                                                     view_line);
+               g_signal_handlers_disconnect_by_func (object, update_dialog_from_move_cb,
+                                                     view_line);
                break;
        default:
                g_print ("response = %d", response);
index 851cec71ea4f5226f406df4360a762e2fd1a7eb6..4e60eda6a070eb521d9d50a795499b5db3630fcf 100644 (file)
@@ -349,6 +349,8 @@ response_cb (GtkDialog     *dialog,
             gint           response,
             glViewText    *view_text)
 {
+       glLabelObject *object;
+
        gl_debug (DEBUG_VIEW, "START");
 
        g_return_if_fail(dialog != NULL);
@@ -359,6 +361,13 @@ response_cb (GtkDialog     *dialog,
                gtk_widget_hide (GTK_WIDGET(dialog));
                break;
        case GTK_RESPONSE_DELETE_EVENT:
+               /* Dialog destroyed, remove callbacks that reference it. */
+               object = gl_view_object_get_object (GL_VIEW_OBJECT(view_text));
+
+               g_signal_handlers_disconnect_by_func (object, update_dialog_cb,
+                                                     view_text);
+               g_signal_handlers_disconnect_by_func (object, update_dialog_from_move_cb,
+                                                     view_text);
                break;
        default:
                g_print ("response = %d", response);