Bug 867459 - Fix gfx rooting hazards r=terrence
authorDavid Zbarsky <dzbarsky@gmail.com>
Thu, 02 May 2013 22:02:40 -0400
changeset 130715 164a107f22027a5c75c534cd4549faf9f93d2609
parent 130714 7ecd038b7b0d2e03adc13f4b386fac1d323af5a4
child 130716 ec1fb05b0095f8d744b35e605527f3a2d2886fd2
push id1579
push userphilringnalda@gmail.com
push dateSat, 04 May 2013 04:38:04 +0000
treeherderfx-team@a56432a42a41 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersterrence
bugs867459
milestone23.0a1
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);