[gnome-builder] libide: don't warn when setting NULL weak pointer



commit f733b172c11db3fb67c57c35265a02605cc1c322
Author: Christian Hergert <christian hergert me>
Date:   Wed Apr 15 17:44:12 2015 -0700

    libide: don't warn when setting NULL weak pointer

 libide/ide-macros.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/libide/ide-macros.h b/libide/ide-macros.h
index d586918..3d7a24d 100644
--- a/libide/ide-macros.h
+++ b/libide/ide-macros.h
@@ -27,7 +27,7 @@ G_BEGIN_DECLS
   (*(ptr) ? (g_object_remove_weak_pointer((GObject*)*(ptr), (gpointer*)ptr),*(ptr)=NULL,1) : 0)
 
 #define ide_set_weak_pointer(ptr,obj) \
-  ((obj!=*(ptr)) ? (ide_clear_weak_pointer(ptr),*(ptr)=obj,g_object_add_weak_pointer((GObject*)obj, 
(gpointer*)ptr),1) : 0)
+  
((obj!=*(ptr))?(ide_clear_weak_pointer(ptr),*(ptr)=obj,((obj)?g_object_add_weak_pointer((GObject*)obj,(gpointer*)ptr),NULL:NULL),1):0)
 
 #define ide_clear_signal_handler(obj,ptr) \
   G_STMT_START { \


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