Add a warning to catch possible refcounting bugs.
authorMichael Vrable <mvrable@cs.ucsd.edu>
Fri, 22 Jan 2010 05:19:31 +0000 (21:19 -0800)
committerMichael Vrable <mvrable@cs.ucsd.edu>
Fri, 22 Jan 2010 05:19:31 +0000 (21:19 -0800)
Not actually needed (was added to track down the corruption fixed in the
last changeset, which was unrelated), but probably worth keeping around.

bluesky/util.c

index eab6a14..2e6f0aa 100644 (file)
@@ -108,6 +108,8 @@ void bluesky_string_resize(BlueSkyRCStr *string, gsize len)
     if (string->len == len)
         return;
 
+    g_warn_if_fail(string->refcount == 1);
+
     string->data = g_realloc(string->data, len);
     string->len = len;
 }