Add a warning to catch possible refcounting bugs.
[bluesky.git] / 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;
 }