[script] Don't error on object unref of NULL

This follows the usage of free with a NULL as well as ply-image etc.
This commit is contained in:
Charlie Brej 2009-06-25 11:39:01 +01:00 committed by Ray Strode
parent 9af3a9d3db
commit 7901df33f9

View file

@ -34,6 +34,8 @@ void script_obj_ref (script_obj* obj)
void script_obj_unref (script_obj* obj)
{
if (!obj) return;
assert(obj->refcount>0);
obj->refcount--;
if (obj->refcount<=0){
script_obj_free (obj);