зеркало из https://github.com/mozilla/pjs.git
fix leak of argument formatters upon JSContext destruction. bug 22802. r=rogerl
This commit is contained in:
Родитель
8e5c753268
Коммит
5b66748af5
|
@ -132,6 +132,7 @@ js_DestroyContext(JSContext *cx, JSGCMode gcmode)
|
||||||
{
|
{
|
||||||
JSRuntime *rt;
|
JSRuntime *rt;
|
||||||
JSBool last;
|
JSBool last;
|
||||||
|
JSArgumentFormatMap *map;
|
||||||
|
|
||||||
rt = cx->runtime;
|
rt = cx->runtime;
|
||||||
|
|
||||||
|
@ -200,6 +201,15 @@ js_DestroyContext(JSContext *cx, JSGCMode gcmode)
|
||||||
if (cx->requestDepth)
|
if (cx->requestDepth)
|
||||||
JS_EndRequest(cx);
|
JS_EndRequest(cx);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* remove any argument formatters */
|
||||||
|
map = cx->argumentFormatMap;
|
||||||
|
while (map) {
|
||||||
|
JSArgumentFormatMap *temp = map;
|
||||||
|
map = map->next;
|
||||||
|
JS_free(cx, temp);
|
||||||
|
}
|
||||||
|
|
||||||
free(cx);
|
free(cx);
|
||||||
|
|
||||||
if (last) {
|
if (last) {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче