mirror of
https://gitlab.freedesktop.org/plymouth/plymouth.git
synced 2026-05-08 10:08:06 +02:00
[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:
parent
9af3a9d3db
commit
7901df33f9
1 changed files with 2 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue