summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Leeds <matthew.leeds@endlessm.com>2019-07-02 15:54:52 -0700
committerMatthew Leeds <matthew.leeds@endlessm.com>2019-07-03 20:28:36 -0700
commitd4db5a828883a040be00dd0f80400132220a1b72 (patch)
tree5cd9981060143b1e3b46b713524e62ef405f5bdf
parent59ce6b10dc93746dcae081d01dbe13a254430b4b (diff)
downloadglib-d4db5a828883a040be00dd0f80400132220a1b72.tar.gz
gtestdbus: Clarify comment on dropping connection ref
In _g_object_unref_and_wait_weak_notify() we take a weak reference and then call g_object_unref() in an idle callback, which may look like we're dropping a strong reference without having one. So change the comment to make it more clear that the reference being dropped is held by the caller.
-rw-r--r--gio/gtestdbus.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gio/gtestdbus.c b/gio/gtestdbus.c
index 6c060aa7c..11cf029d9 100644
--- a/gio/gtestdbus.c
+++ b/gio/gtestdbus.c
@@ -84,8 +84,9 @@ _g_object_unref_and_wait_weak_notify (gpointer object)
g_object_weak_ref (object, (GWeakNotify) g_main_loop_quit, data.loop);
- /* Drop the ref in an idle callback, this is to make sure the mainloop
- * is already running when weak notify happens */
+ /* Drop the strong ref held by the caller in an idle callback. This is to
+ * make sure the mainloop is already running when weak notify happens (when
+ * all other strong ref holders have dropped theirs). */
g_idle_add (unref_on_idle, object);
/* Make sure we don't block forever */