mirror of
https://github.com/brl/mutter.git
synced 2024-11-12 17:27:03 -05:00
Return and warn if a handle's refcount is <= 0
This makes it more likely consumers notice invalid unreferences. GObject has the same assertion. http://bugzilla.openedhand.com/show_bug.cgi?id=2029 Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
This commit is contained in:
parent
9fc9aa562e
commit
89519a1d33
@ -78,6 +78,7 @@ cogl_handle_unref (CoglHandle handle)
|
||||
CoglHandleObject *obj = (CoglHandleObject *)handle;
|
||||
|
||||
g_return_if_fail (handle != COGL_INVALID_HANDLE);
|
||||
g_return_if_fail (obj->ref_count > 0);
|
||||
|
||||
if (--obj->ref_count < 1)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user