mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 858900 - Poison JSContext. r=luke
This commit is contained in:
parent
31cb07457a
commit
65bd5aa1b7
@ -508,6 +508,17 @@ js_delete(T *p)
|
||||
}
|
||||
}
|
||||
|
||||
template<class T>
|
||||
static JS_ALWAYS_INLINE void
|
||||
js_delete_poison(T *p)
|
||||
{
|
||||
if (p) {
|
||||
p->~T();
|
||||
memset(p, 0x3B, sizeof(T));
|
||||
js_free(p);
|
||||
}
|
||||
}
|
||||
|
||||
template <class T>
|
||||
static JS_ALWAYS_INLINE T *
|
||||
js_pod_malloc()
|
||||
|
@ -431,7 +431,7 @@ js::DestroyContext(JSContext *cx, DestroyContextMode mode)
|
||||
JS::PrepareForFullGC(rt);
|
||||
GC(rt, GC_NORMAL, JS::gcreason::DESTROY_CONTEXT);
|
||||
}
|
||||
js_delete(cx);
|
||||
js_delete_poison(cx);
|
||||
}
|
||||
|
||||
bool
|
||||
|
Loading…
Reference in New Issue
Block a user