From: Michael Vrable Date: Fri, 22 Jan 2010 05:19:31 +0000 (-0800) Subject: Add a warning to catch possible refcounting bugs. X-Git-Url: http://git.vrable.net/?a=commitdiff_plain;h=d97af3e024253910cd60350e0504ea64711fbb00;p=bluesky.git Add a warning to catch possible refcounting bugs. Not actually needed (was added to track down the corruption fixed in the last changeset, which was unrelated), but probably worth keeping around. --- diff --git a/bluesky/util.c b/bluesky/util.c index eab6a14..2e6f0aa 100644 --- a/bluesky/util.c +++ b/bluesky/util.c @@ -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; }