mirror of
https://gitee.com/zlgopen/awtk.git
synced 2024-12-01 11:39:01 +08:00
improve fscript_set_global_object
This commit is contained in:
parent
30f5ee345d
commit
eb3c109af7
@ -3243,10 +3243,13 @@ tk_object_t* fscript_get_global_object(void) {
|
||||
}
|
||||
|
||||
ret_t fscript_set_global_object(tk_object_t* obj) {
|
||||
TK_OBJECT_UNREF(s_global_obj);
|
||||
tk_object_t* old_global_obj = s_global_obj;
|
||||
return_value_if_fail(obj != s_global_obj, RET_BAD_PARAMS);
|
||||
|
||||
TK_OBJECT_REF(obj);
|
||||
s_global_obj = obj;
|
||||
|
||||
TK_OBJECT_UNREF(old_global_obj);
|
||||
|
||||
return RET_OK;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user