summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2016-12-13 14:18:47 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2016-12-13 14:18:47 (GMT)
commitba6ca32c37c5db2582a015ed15d6ba128c36968e (patch)
treeabce29c9eefb9ddfd6ae6cb23c727e532adb2d22
parentc1ca3b52ee3103178e4fc3ff3bb4e26bb9865818 (diff)
Fixed a runtime warning by referencing binaries with care.
-rw-r--r--ChangeLog5
-rw-r--r--src/gui/editem.c4
2 files changed, 8 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 2ee17fb..856c430 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
16-12-13 Cyrille Bagard <nocbos@gmail.com>
+ * src/gui/editem.c:
+ Fix a runtime warning by referencing binaries with care.
+
+16-12-13 Cyrille Bagard <nocbos@gmail.com>
+
* src/core/core.c:
* src/gui/core/core.c:
Move the registration of sharing hash tables.
diff --git a/src/gui/editem.c b/src/gui/editem.c
index 9c86cd6..fc502a0 100644
--- a/src/gui/editem.c
+++ b/src/gui/editem.c
@@ -250,7 +250,9 @@ void change_editor_items_current_binary(GObject *ref, GLoadedBinary *binary)
GEditorItem *iter; /* Boucle de parcours */
GEditorItemClass *klass; /* Classe correspondante */
- g_object_ref(G_OBJECT(binary));
+ if (binary != NULL)
+ g_object_ref(G_OBJECT(binary));
+
g_object_set_data_full(ref, "current_binary", binary, g_object_unref);
editem_list_for_each(iter, _editem_list)