[gimp/gimp-2-8] app: don't pass NULL to g_object_add_weak_pointer



commit 42e370e20822b248b86fe2012663109aaa7f7808
Author: Massimo Valentini <mvalentini src gnome org>
Date:   Fri Jul 5 18:13:46 2013 +0200

    app: don't pass NULL to g_object_add_weak_pointer
    
    opening many images from the command line used to print:
    
    (gimp-2.9:): GLib-GObject-CRITICAL **: g_object_add_weak_pointer:
    assertion 'G_IS_OBJECT (object)' failed
    
    because only the first finds the empty display
    (cherry picked from commit 8a7d5c9d165514f4ee9afdc30cffd6c130aa7588)

 app/file/file-open.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/app/file/file-open.c b/app/file/file-open.c
index fdf73f3..be6a3fe 100644
--- a/app/file/file-open.c
+++ b/app/file/file-open.c
@@ -562,7 +562,8 @@ file_open_from_command_line (Gimp        *gimp,
       GimpObject        *display = gimp_get_empty_display (gimp);
       GimpPDBStatusType  status;
 
-      g_object_add_weak_pointer (G_OBJECT (display), (gpointer) &display);
+      if (display)
+        g_object_add_weak_pointer (G_OBJECT (display), (gpointer) &display);
 
       image = file_open_with_display (gimp,
                                       gimp_get_user_context (gimp),


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]