Prevent testapi from reporting false leaks.
authormrowe@apple.com <mrowe@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 18 Nov 2007 05:36:52 +0000 (05:36 +0000)
committermrowe@apple.com <mrowe@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 18 Nov 2007 05:36:52 +0000 (05:36 +0000)
Clear out local variables pointing at JSObjectRefs to allow their values to be collected.

Reviewed by Sam Weinig.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@27882 268f45cc-cd09-0410-ab3c-d52691b4dbfc

JavaScriptCore/API/testapi.c
JavaScriptCore/ChangeLog

index 6029d9204e698dd7dd1e06455ce12c83730e0c02..d9ac33cdb7e91829cd0f4992ff8a2bfcf3060c41 100644 (file)
@@ -828,6 +828,12 @@ int main(int argc, char* argv[])
         free(scriptUTF8);
     }
 
+    // Clear out local variables pointing at JSObjectRefs to allow their values to be collected
+    function = NULL;
+    v = NULL;
+    o = NULL;
+    globalObject = NULL;
+
     JSStringRelease(jsEmptyIString);
     JSStringRelease(jsOneIString);
     JSStringRelease(jsCFIString);
@@ -836,7 +842,7 @@ int main(int argc, char* argv[])
     JSStringRelease(jsCFEmptyIStringWithCharacters);
     JSStringRelease(goodSyntax);
     JSStringRelease(badSyntax);
-    
+
     JSGlobalContextRelease(context);
     JSGarbageCollect(context);
     JSClassRelease(globalObjectClass);
index 8e49d56d6464253a358eabe5cf9caeb61e3df7a1..0b7f6e5303bfe2cc50e2edd439fed73fe82966e7 100644 (file)
@@ -1,3 +1,13 @@
+2007-11-17  Mark Rowe  <mrowe@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        Prevent testapi from reporting false leaks.  Clear out local variables pointing at
+        JSObjectRefs to allow their values to be collected.
+
+        * API/testapi.c:
+        (main):
+
 2007-11-17  Mark Rowe  <mrowe@apple.com>
 
         Reviewed by Sam Weinig.