mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1022954 - ScriptSource leaks sourceMapURL_ sometimes. r=jimb
This commit is contained in:
parent
32b182c4a7
commit
60a9b99fa1
@ -65,9 +65,6 @@ leak:AllocateArrayBufferContents
|
||||
# Bug 1022010 - Small leak under _render_glyph_outline. bc1
|
||||
leak:_render_glyph_outline
|
||||
|
||||
# Bug 1022954 - ScriptSource leaks sourceMapURL_ sometimes. dt
|
||||
leak:ScriptSource::setSourceMapURL
|
||||
|
||||
# Bug 1023548 - Small leak under SECITEM_AllocItem_Util. bc1, bc3
|
||||
leak:SECITEM_AllocItem_Util
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
//@ sourceMappingURL=bar.js.map
|
||||
//# sourceMappingURL=bar.js.map
|
||||
|
||||
// Define a single function to prevent script source from being gc'd
|
||||
function foo() {}
|
||||
|
@ -1864,6 +1864,7 @@ ScriptSource::performXDR(XDRState<mode> *xdr)
|
||||
|
||||
if (mode == XDR_DECODE) {
|
||||
size_t byteLen = (sourceMapURLLen + 1) * sizeof(jschar);
|
||||
MOZ_ASSERT(!sourceMapURL_, "Don't leak sourceMapURL_");
|
||||
sourceMapURL_ = static_cast<jschar *>(xdr->cx()->malloc_(byteLen));
|
||||
if (!sourceMapURL_)
|
||||
return false;
|
||||
@ -2035,14 +2036,16 @@ ScriptSource::setSourceMapURL(ExclusiveContext *cx, const jschar *sourceMapURL)
|
||||
{
|
||||
JS_ASSERT(sourceMapURL);
|
||||
if (hasSourceMapURL()) {
|
||||
if (cx->isJSContext() &&
|
||||
!JS_ReportErrorFlagsAndNumber(cx->asJSContext(), JSREPORT_WARNING,
|
||||
js_GetErrorMessage, nullptr,
|
||||
JSMSG_ALREADY_HAS_PRAGMA, filename_,
|
||||
"//# sourceMappingURL"))
|
||||
{
|
||||
return false;
|
||||
// Warn about the replacement, but use the new one.
|
||||
if (cx->isJSContext()) {
|
||||
JS_ReportErrorFlagsAndNumber(cx->asJSContext(), JSREPORT_WARNING,
|
||||
js_GetErrorMessage, nullptr,
|
||||
JSMSG_ALREADY_HAS_PRAGMA, filename_,
|
||||
"//# sourceMappingURL");
|
||||
}
|
||||
|
||||
js_free(sourceMapURL_);
|
||||
sourceMapURL_ = nullptr;
|
||||
}
|
||||
|
||||
size_t len = js_strlen(sourceMapURL) + 1;
|
||||
|
Loading…
Reference in New Issue
Block a user