Bug 868783 - Fix rooting hazards in nsXBLSerialize.cpp; r=till
authorEhsan Akhgari <ehsan@mozilla.com>
Sat, 04 May 2013 19:48:13 -0400
changeset 141810 cc6ab8b33ec7290e8c2721fb6fbc661f8c21db71
parent 141809 2869e8de267f8803211238b5b4eb740f11466869
child 141811 fb15fa84d8d957c7f253757d2164c6b138dded95
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)
reviewerstill
bugs868783
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 868783 - Fix rooting hazards in nsXBLSerialize.cpp; r=till
content/xbl/src/nsXBLSerialize.cpp
--- a/content/xbl/src/nsXBLSerialize.cpp
+++ b/content/xbl/src/nsXBLSerialize.cpp
@@ -11,17 +11,18 @@
 using namespace mozilla;
 
 nsresult
 XBL_SerializeFunction(nsIScriptContext* aContext,
                       nsIObjectOutputStream* aStream,
                       JSObject* aFunctionObject)
 {
   AutoPushJSContext cx(aContext->GetNativeContext());
-  return nsContentUtils::XPConnect()->WriteFunction(aStream, cx, aFunctionObject);
+  JS::RootedObject function(cx, aFunctionObject);
+  return nsContentUtils::XPConnect()->WriteFunction(aStream, cx, function);
 }
 
 nsresult
 XBL_DeserializeFunction(nsIScriptContext* aContext,
                         nsIObjectInputStream* aStream,
                         JS::MutableHandle<JSObject*> aFunctionObjectp)
 {
   AutoPushJSContext cx(aContext->GetNativeContext());