Skip to content

Commit

Permalink
Only call LayerTransactionChild::Destroy on the main thread. (bug 132…
Browse files Browse the repository at this point in the history
…8633, r=mattwoodrow)
  • Loading branch information
David Anderson committed Feb 8, 2017
1 parent ea0cbd8 commit cd897b6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion gfx/layers/ipc/ShadowLayers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,14 @@ ShadowLayerForwarder::~ShadowLayerForwarder()
delete mTxn;
if (mShadowManager) {
mShadowManager->SetForwarder(nullptr);
mShadowManager->Destroy();
if (NS_IsMainThread()) {
mShadowManager->Destroy();
} else {
NS_DispatchToMainThread(
NewRunnableMethod(mShadowManager, &LayerTransactionChild::Destroy));
}
}

if (!NS_IsMainThread()) {
NS_DispatchToMainThread(
new ReleaseOnMainThreadTask<ActiveResourceTracker>(mActiveResourceTracker));
Expand Down

0 comments on commit cd897b6

Please sign in to comment.