mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
bug 426162 - allow calling JS_DestroyContext when cx->thread is null for API compatibility. r=brendan
This commit is contained in:
parent
f51ef2ceec
commit
0a955fa410
@ -538,7 +538,14 @@ js_DestroyContext(JSContext *cx, JSDestroyContextMode mode)
|
||||
JSBool last;
|
||||
|
||||
#ifdef JS_THREADSAFE
|
||||
JS_ASSERT(CURRENT_THREAD_IS_ME(cx->thread));
|
||||
/*
|
||||
* For API compatibility we allow to destroy contexts without a thread in
|
||||
* optimized builds. We assume that the embedding knows that an OOM error
|
||||
* cannot happen in JS_SetContextThread.
|
||||
*/
|
||||
JS_ASSERT(cx->thread && CURRENT_THREAD_IS_ME(cx->thread));
|
||||
if (!cx->thread)
|
||||
JS_SetContextThread(cx);
|
||||
#endif
|
||||
rt = cx->runtime;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user