Fix for bug 617247 (Don't call HoldScriptObject if we don't have a script object). r=sicking.
authorPeter Van der Beken <peterv@propagandism.org>
Thu, 24 Mar 2011 11:53:28 +0100
changeset 64566 36089a888097768ff8d854153ab906f869822bea
parent 64565 3002f08d9420cbbf71df9c4aeac3b301ba339350
child 64567 a0adf7f6b4bda329e672ef90a0e47f47a35c8b2a
push idunknown
push userunknown
push dateunknown
reviewerssicking
bugs617247
milestone2.2a1pre
Fix for bug 617247 (Don't call HoldScriptObject if we don't have a script object). r=sicking.
content/xul/content/src/nsXULElement.h
--- a/content/xul/content/src/nsXULElement.h
+++ b/content/xul/content/src/nsXULElement.h
@@ -354,17 +354,19 @@ public:
 
         mScriptObject.mLangID = aHolder.getScriptTypeID();
         Set((void*)aHolder);
     }
     void Set(void *aObject)
     {
         NS_ASSERTION(!mScriptObject.mObject, "Leaking script object.");
         if (!aObject) {
-          return;
+            mScriptObject.mObject = nsnull;
+
+            return;
         }
 
         nsresult rv = nsContentUtils::HoldScriptObject(mScriptObject.mLangID,
                                                        this,
                                                        &NS_CYCLE_COLLECTION_NAME(nsXULPrototypeNode),
                                                        aObject, PR_FALSE);
         if (NS_SUCCEEDED(rv)) {
             mScriptObject.mObject = aObject;