Skip to content
Snippets Groups Projects
Verified Commit 3a0cf696 authored by Nazım Can Altınova's avatar Nazım Can Altınova Committed by Pier Angelo Vendrame
Browse files

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

parent df5a9824
Branches
Tags
1 merge request!1453TB 43587: Rebased legacy onto 115.22.0esr
......@@ -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