summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--dom/canvas/ImageBitmap.cpp2
-rw-r--r--dom/workers/WorkerPrivate.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/dom/canvas/ImageBitmap.cpp b/dom/canvas/ImageBitmap.cpp
index bb47618a6..62de20763 100644
--- a/dom/canvas/ImageBitmap.cpp
+++ b/dom/canvas/ImageBitmap.cpp
@@ -930,7 +930,7 @@ ImageBitmap::CreateInternal(nsIGlobalObject* aGlobal, ImageData& aImageData,
const Maybe<IntRect>& aCropRect, ErrorResult& aRv)
{
// Copy data into SourceSurface.
- dom::Uint8ClampedArray array;
+ RootedTypedArray<Uint8ClampedArray> array(RootingCx());
DebugOnly<bool> inited = array.Init(aImageData.GetDataObject());
MOZ_ASSERT(inited);
diff --git a/dom/workers/WorkerPrivate.cpp b/dom/workers/WorkerPrivate.cpp
index 860bf8468..1f8b3b70c 100644
--- a/dom/workers/WorkerPrivate.cpp
+++ b/dom/workers/WorkerPrivate.cpp
@@ -6392,7 +6392,7 @@ WorkerPrivate::GarbageCollectInternal(JSContext* aCx, bool aShrinking,
if (aShrinking || aCollectChildren) {
JS::PrepareForFullGC(aCx);
- if (aShrinking) {
+ if (aShrinking && mSyncLoopStack.IsEmpty()) {
JS::GCForReason(aCx, GC_SHRINK, JS::gcreason::DOM_WORKER);
if (!aCollectChildren) {