mirror of
https://github.com/brl/mutter.git
synced 2024-12-24 12:02:04 +00: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
c274118a8f
commit
60d8369a1a
@ -78,6 +78,7 @@ cogl_handle_unref (CoglHandle handle)
|
|||||||
CoglHandleObject *obj = (CoglHandleObject *)handle;
|
CoglHandleObject *obj = (CoglHandleObject *)handle;
|
||||||
|
|
||||||
g_return_if_fail (handle != COGL_INVALID_HANDLE);
|
g_return_if_fail (handle != COGL_INVALID_HANDLE);
|
||||||
|
g_return_if_fail (obj->ref_count > 0);
|
||||||
|
|
||||||
if (--obj->ref_count < 1)
|
if (--obj->ref_count < 1)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user