mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 801176 - part8-v1: Fix memory leak in OffscreenCanvas. r=roc
--- dom/canvas/CanvasRenderingContext2D.cpp | 2 ++ dom/canvas/OffscreenCanvas.cpp | 12 +++++++----- 2 files changed, 9 insertions(+), 5 deletions(-)
This commit is contained in:
parent
a7dc8e10f8
commit
175d8007c3
@ -886,6 +886,7 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(CanvasRenderingContext2D)
|
||||
// since we're logically destructed at this point.
|
||||
CanvasRenderingContext2D::RemoveDemotableContext(tmp);
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK(mCanvasElement)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK(mOffscreenCanvas)
|
||||
for (uint32_t i = 0; i < tmp->mStyleStack.Length(); i++) {
|
||||
ImplCycleCollectionUnlink(tmp->mStyleStack[i].patternStyles[Style::STROKE]);
|
||||
ImplCycleCollectionUnlink(tmp->mStyleStack[i].patternStyles[Style::FILL]);
|
||||
@ -903,6 +904,7 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_END
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(CanvasRenderingContext2D)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mCanvasElement)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mOffscreenCanvas)
|
||||
for (uint32_t i = 0; i < tmp->mStyleStack.Length(); i++) {
|
||||
ImplCycleCollectionTraverse(cb, tmp->mStyleStack[i].patternStyles[Style::STROKE], "Stroke CanvasPattern");
|
||||
ImplCycleCollectionTraverse(cb, tmp->mStyleStack[i].patternStyles[Style::FILL], "Fill CanvasPattern");
|
||||
|
@ -89,11 +89,13 @@ OffscreenCanvas::ClearResources()
|
||||
mCanvasClient = nullptr;
|
||||
|
||||
if (mCanvasRenderer) {
|
||||
nsCOMPtr<nsIThread> activeThread = mCanvasRenderer->GetActiveThread();
|
||||
MOZ_RELEASE_ASSERT(activeThread);
|
||||
bool current;
|
||||
activeThread->IsOnCurrentThread(¤t);
|
||||
MOZ_RELEASE_ASSERT(current);
|
||||
if (mCanvasRenderer->mGLContext) {
|
||||
nsCOMPtr<nsIThread> activeThread = mCanvasRenderer->GetActiveThread();
|
||||
MOZ_RELEASE_ASSERT(activeThread);
|
||||
bool current;
|
||||
activeThread->IsOnCurrentThread(¤t);
|
||||
MOZ_RELEASE_ASSERT(current);
|
||||
}
|
||||
mCanvasRenderer->SetCanvasClient(nullptr);
|
||||
mCanvasRenderer->mContext = nullptr;
|
||||
mCanvasRenderer->mGLContext = nullptr;
|
||||
|
Loading…
Reference in New Issue
Block a user