Skip to content
Snippets Groups Projects
Verified Commit 6b0945a7 authored by Nazım Can Altınova's avatar Nazım Can Altınova Committed by ma1
Browse files

Bug 1943912 - Do not reset the chunk manager while shutdown a=dmeehan

parent 5d037355
Branches
Tags tor-browser-115.21.0esr-13.5-1-build2
No related merge requests found
......@@ -139,6 +139,12 @@ void ProfilerChild::SetupChunkManager() {
});
}
/* static */ void ProfilerChild::ClearPendingUpdate() {
auto lockedUpdate = sPendingChunkManagerUpdate.Lock();
lockedUpdate->mProfilerChild = nullptr;
lockedUpdate->mUpdate.Clear();
}
void ProfilerChild::ResetChunkManager() {
if (!mChunkManager) {
return;
......@@ -149,9 +155,7 @@ void ProfilerChild::ResetChunkManager() {
mChunkManager->SetUpdateCallback({});
// Clear the pending update.
auto lockedUpdate = sPendingChunkManagerUpdate.Lock();
lockedUpdate->mProfilerChild = nullptr;
lockedUpdate->mUpdate.Clear();
ClearPendingUpdate();
// And process a final update right now.
ProcessChunkManagerUpdate(
ProfileBufferControlledChunkManager::Update(nullptr));
......@@ -483,7 +487,7 @@ void ProfilerChild::ActorDestroy(ActorDestroyReason aActorDestroyReason) {
}
void ProfilerChild::Destroy() {
ResetChunkManager();
ClearPendingUpdate();
if (!mDestroyed) {
Close();
}
......
......
......@@ -81,6 +81,8 @@ class ProfilerChild final : public PProfilerChild,
void ProcessChunkManagerUpdate(
ProfileBufferControlledChunkManager::Update&& aUpdate);
static void ClearPendingUpdate();
static void GatherProfileThreadFunction(void* already_AddRefedParameters);
nsCOMPtr<nsIThread> mThread;
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment