Fixes NB#114785, fixes a crash when removing attachments.
authorSergio Villar Senín <svillar@igalia.com>
Tue, 5 May 2009 16:51:18 +0000 (18:51 +0200)
committerSergio Villar Senín <svillar@igalia.com>
Tue, 5 May 2009 16:51:45 +0000 (18:51 +0200)
Sets a proper clear function for the call to gtk_clipboard_set_with_owner. It must not be NULL.

src/widgets/modest-attachments-view.c

index f01c51f..a269d4f 100644 (file)
@@ -935,7 +935,6 @@ modest_attachments_view_get_sizes (ModestAttachmentsView *attachments_view,
                                size = 32768;
                        }
                        *attachments_size += size;
                                size = 32768;
                        }
                        *attachments_size += size;
-                       
                }
                g_object_unref (part);
        }
                }
                g_object_unref (part);
        }
@@ -943,6 +942,13 @@ modest_attachments_view_get_sizes (ModestAttachmentsView *attachments_view,
 }
 
 static void
 }
 
 static void
+dummy_clear_func (GtkClipboard *clipboard,
+                 gpointer user_data_or_owner)
+{
+       /* Do nothing */
+}
+
+static void
 own_clipboard (ModestAttachmentsView *atts_view)
 {
        GtkTargetEntry targets[] = {
 own_clipboard (ModestAttachmentsView *atts_view)
 {
        GtkTargetEntry targets[] = {
@@ -951,8 +957,7 @@ own_clipboard (ModestAttachmentsView *atts_view)
 
        gtk_clipboard_set_with_owner (gtk_widget_get_clipboard (GTK_WIDGET (atts_view), GDK_SELECTION_PRIMARY),
                                      targets, G_N_ELEMENTS (targets),
 
        gtk_clipboard_set_with_owner (gtk_widget_get_clipboard (GTK_WIDGET (atts_view), GDK_SELECTION_PRIMARY),
                                      targets, G_N_ELEMENTS (targets),
-                                     clipboard_get, NULL, G_OBJECT(atts_view));
-                             
+                                     clipboard_get, dummy_clear_func, G_OBJECT(atts_view));
 }
 
 static gboolean 
 }
 
 static gboolean