Bug 867459 - Fix gfx rooting hazards r=terrence
authorDavid Zbarsky <dzbarsky@gmail.com>
Thu, 02 May 2013 22:02:40 -0400
changeset 141650 164a107f22027a5c75c534cd4549faf9f93d2609
parent 141649 7ecd038b7b0d2e03adc13f4b386fac1d323af5a4
child 141651 ec1fb05b0095f8d744b35e605527f3a2d2886fd2
push id2579
push userakeybl@mozilla.com
push dateMon, 24 Jun 2013 18:52:47 +0000
treeherdermozilla-beta@b69b7de8a05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersterrence
bugs867459
milestone23.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 867459 - Fix gfx rooting hazards r=terrence
gfx/src/nsScriptableRegion.cpp
--- a/gfx/src/nsScriptableRegion.cpp
+++ b/gfx/src/nsScriptableRegion.cpp
@@ -122,17 +122,17 @@ NS_IMETHODIMP nsScriptableRegion::GetRec
 {
   uint32_t numRects = mRegion.GetNumRects();
 
   if (!numRects) {
     *aRects = JSVAL_NULL;
     return NS_OK;
   }
 
-  JSObject* destArray = JS_NewArrayObject(aCx, numRects * 4, NULL);
+  JS::Rooted<JSObject*> destArray(aCx, JS_NewArrayObject(aCx, numRects * 4, nullptr));
   if (!destArray) {
     return NS_ERROR_OUT_OF_MEMORY;
   }
 
   *aRects = OBJECT_TO_JSVAL(destArray);
 
   uint32_t n = 0;
   nsIntRegionRectIterator iter(mRegion);