Skip to content
Snippets Groups Projects
Commit e089564a authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

May as well check the signature in the OnExit handler too.

parent a32b5ade
No related branches found
No related tags found
No related merge requests found
...@@ -799,7 +799,7 @@ void DLLCALL js_EvalOnExit(JSContext *cx, JSObject *obj, js_callback_t* cb) ...@@ -799,7 +799,7 @@ void DLLCALL js_EvalOnExit(JSContext *cx, JSObject *obj, js_callback_t* cb)
BOOL auto_terminate=cb->auto_terminate; BOOL auto_terminate=cb->auto_terminate;
JSObject *glob=JS_GetGlobalObject(cx); JSObject *glob=JS_GetGlobalObject(cx);
global_private_t *pt; global_private_t *pt;
str_list_t list; str_list_t list = NULL;
if(glob==obj) { if(glob==obj) {
pt=(global_private_t *)JS_GetPrivate(cx,JS_GetGlobalObject(cx)); pt=(global_private_t *)JS_GetPrivate(cx,JS_GetGlobalObject(cx));
...@@ -807,11 +807,17 @@ void DLLCALL js_EvalOnExit(JSContext *cx, JSObject *obj, js_callback_t* cb) ...@@ -807,11 +807,17 @@ void DLLCALL js_EvalOnExit(JSContext *cx, JSObject *obj, js_callback_t* cb)
} }
else { else {
struct onexit_private *oep = JS_GetPrivate(cx,obj); struct onexit_private *oep = JS_GetPrivate(cx,obj);
if (oep == NULL) if (oep != NULL) {
list = NULL; if (oep->signature[0] == 'o'
else { || oep->signature[1] == 'n'
list = oep->list; || oep->signature[2] == 'e'
free(oep); || oep->signature[3] == 'x'
|| oep->signature[4] == 'i'
|| oep->signature[5] == 't'
|| oep->signature[6] == 0) {
list = oep->list;
free(oep);
}
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment