mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 797940: Don't use a static nsRefPtr for sScriptCacheCleaner. r=smaug
This commit is contained in:
parent
3b1062dc73
commit
17621cc7a7
@ -769,7 +769,7 @@ ContentScriptErrorReporter(JSContext* aCx,
|
||||
|
||||
nsDataHashtable<nsStringHashKey, nsFrameJSScriptExecutorHolder*>*
|
||||
nsFrameScriptExecutor::sCachedScripts = nullptr;
|
||||
nsRefPtr<nsScriptCacheCleaner> nsFrameScriptExecutor::sScriptCacheCleaner;
|
||||
nsScriptCacheCleaner* nsFrameScriptExecutor::sScriptCacheCleaner = nullptr;
|
||||
|
||||
void
|
||||
nsFrameScriptExecutor::DidCreateCx()
|
||||
@ -780,7 +780,9 @@ nsFrameScriptExecutor::DidCreateCx()
|
||||
new nsDataHashtable<nsStringHashKey, nsFrameJSScriptExecutorHolder*>;
|
||||
sCachedScripts->Init();
|
||||
|
||||
sScriptCacheCleaner = new nsScriptCacheCleaner();
|
||||
nsRefPtr<nsScriptCacheCleaner> scriptCacheCleaner =
|
||||
new nsScriptCacheCleaner();
|
||||
scriptCacheCleaner.forget(&sScriptCacheCleaner);
|
||||
}
|
||||
}
|
||||
|
||||
@ -835,7 +837,8 @@ nsFrameScriptExecutor::Shutdown()
|
||||
delete sCachedScripts;
|
||||
sCachedScripts = nullptr;
|
||||
|
||||
sScriptCacheCleaner = nullptr;
|
||||
nsRefPtr<nsScriptCacheCleaner> scriptCacheCleaner;
|
||||
scriptCacheCleaner.swap(sScriptCacheCleaner);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -271,7 +271,7 @@ protected:
|
||||
bool mDelayedCxDestroy;
|
||||
nsCOMPtr<nsIPrincipal> mPrincipal;
|
||||
static nsDataHashtable<nsStringHashKey, nsFrameJSScriptExecutorHolder*>* sCachedScripts;
|
||||
static nsRefPtr<nsScriptCacheCleaner> sScriptCacheCleaner;
|
||||
static nsScriptCacheCleaner* sScriptCacheCleaner;
|
||||
};
|
||||
|
||||
class nsFrameScriptCx
|
||||
|
Loading…
Reference in New Issue
Block a user