mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 15:52:07 +00:00
Bug 1202424 - Free shared memory when IPC system shuts down, not after. r=mrbkap
This commit is contained in:
parent
4d0fe31fbc
commit
d49de0d545
@ -766,6 +766,18 @@ CamerasParent::RecvStopCapture(const int& aCapEngine,
|
||||
return SendReplySuccess();
|
||||
}
|
||||
|
||||
void
|
||||
CamerasParent::StopIPC()
|
||||
{
|
||||
MOZ_ASSERT(!mDestroyed);
|
||||
// Release shared memory now, it's our last chance
|
||||
mShmemPool.Cleanup(this);
|
||||
// We don't want to receive callbacks or anything if we can't
|
||||
// forward them anymore anyway.
|
||||
mChildIsAlive = false;
|
||||
mDestroyed = true;
|
||||
}
|
||||
|
||||
bool
|
||||
CamerasParent::RecvAllDone()
|
||||
{
|
||||
@ -791,8 +803,6 @@ void CamerasParent::DoShutdown()
|
||||
}
|
||||
}
|
||||
|
||||
mShmemPool.Cleanup(this);
|
||||
|
||||
mPBackgroundThread = nullptr;
|
||||
|
||||
if (mVideoCaptureThread) {
|
||||
@ -809,10 +819,7 @@ CamerasParent::ActorDestroy(ActorDestroyReason aWhy)
|
||||
{
|
||||
// No more IPC from here
|
||||
LOG((__PRETTY_FUNCTION__));
|
||||
// We don't want to receive callbacks or anything if we can't
|
||||
// forward them anymore anyway.
|
||||
mChildIsAlive = false;
|
||||
mDestroyed = true;
|
||||
StopIPC();
|
||||
CloseEngines();
|
||||
}
|
||||
|
||||
|
@ -117,6 +117,7 @@ protected:
|
||||
void CloseEngines();
|
||||
bool EnsureInitialized(int aEngine);
|
||||
void DoShutdown();
|
||||
void StopIPC();
|
||||
|
||||
EngineHelper mEngines[CaptureEngine::MaxEngine];
|
||||
nsTArray<CallbackHelper*> mCallbacks;
|
||||
|
Loading…
Reference in New Issue
Block a user