Bug 691976 - NULL check the JSContext before using JS_updateMallocCounter. r=Bas

This commit is contained in:
Matt Woodrow 2011-10-26 16:13:24 +13:00
Родитель 9fc01ffbc5
Коммит dcf9ee4bf1
1 изменённых файлов: 4 добавлений и 1 удалений

Просмотреть файл

@ -1264,7 +1264,10 @@ nsCanvasRenderingContext2DAzure::SetDimensions(PRInt32 width, PRInt32 height)
}
gCanvasAzureMemoryUsed += width * height * 4;
JS_updateMallocCounter(nsContentUtils::GetCurrentJSContext(), width * height * 4);
JSContext* context = nsContentUtils::GetCurrentJSContext();
if (context) {
JS_updateMallocCounter(context, width * height * 4);
}
}
return InitializeWithTarget(target, width, height);