[SCM] WebKit Debian packaging branch, debian/experimental, updated. debian/1.3.8-1-1049-g2e11a8e

dbates at webkit.org dbates at webkit.org
Fri Jan 21 14:54:57 UTC 2011


The following commit has been merged in the debian/experimental branch:
commit 60e3b9e0b79a8fa8cece3c8e1b83b99fcb8a267e
Author: dbates at webkit.org <dbates at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Jan 4 19:29:19 2011 +0000

    2011-01-04  Daniel Bates  <dbates at rim.com>
    
            Reviewed by Adam Roben.
    
            LEAK: Deallocate instance of ThreadFunctionInvocation if thread creation fails
            https://bugs.webkit.org/show_bug.cgi?id=51860
    
            * wtf/ThreadingWin.cpp:
            (WTF::createThreadInternal):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74983 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog
index f655c8d..72b9324 100644
--- a/Source/JavaScriptCore/ChangeLog
+++ b/Source/JavaScriptCore/ChangeLog
@@ -1,3 +1,13 @@
+2011-01-04  Daniel Bates  <dbates at rim.com>
+
+        Reviewed by Adam Roben.
+
+        LEAK: Deallocate instance of ThreadFunctionInvocation if thread creation fails
+        https://bugs.webkit.org/show_bug.cgi?id=51860
+
+        * wtf/ThreadingWin.cpp:
+        (WTF::createThreadInternal):
+
 2011-01-04  Laszlo Gombos  <laszlo.1.gombos at nokia.com>
 
         Reviewed by Ariya Hidayat.
diff --git a/Source/JavaScriptCore/wtf/ThreadingWin.cpp b/Source/JavaScriptCore/wtf/ThreadingWin.cpp
index 3e9df2c..00319a4 100644
--- a/Source/JavaScriptCore/wtf/ThreadingWin.cpp
+++ b/Source/JavaScriptCore/wtf/ThreadingWin.cpp
@@ -208,13 +208,13 @@ ThreadIdentifier createThreadInternal(ThreadFunction entryPoint, void* data, con
 {
     unsigned threadIdentifier = 0;
     ThreadIdentifier threadID = 0;
-    ThreadFunctionInvocation* invocation = new ThreadFunctionInvocation(entryPoint, data);
+    OwnPtr<ThreadFunctionInvocation> invocation = adoptPtr(new ThreadFunctionInvocation(entryPoint, data));
 #if OS(WINCE)
     // This is safe on WINCE, since CRT is in the core and innately multithreaded.
     // On desktop Windows, need to use _beginthreadex (not available on WinCE) if using any CRT functions
-    HANDLE threadHandle = CreateThread(0, 0, (LPTHREAD_START_ROUTINE)wtfThreadEntryPoint, invocation, 0, (LPDWORD)&threadIdentifier);
+    HANDLE threadHandle = CreateThread(0, 0, (LPTHREAD_START_ROUTINE)wtfThreadEntryPoint, invocation.get(), 0, (LPDWORD)&threadIdentifier);
 #else
-    HANDLE threadHandle = reinterpret_cast<HANDLE>(_beginthreadex(0, 0, wtfThreadEntryPoint, invocation, 0, &threadIdentifier));
+    HANDLE threadHandle = reinterpret_cast<HANDLE>(_beginthreadex(0, 0, wtfThreadEntryPoint, invocation.get(), 0, &threadIdentifier));
 #endif
     if (!threadHandle) {
 #if OS(WINCE)
@@ -227,6 +227,9 @@ ThreadIdentifier createThreadInternal(ThreadFunction entryPoint, void* data, con
         return 0;
     }
 
+    // The thread will take ownership of invocation.
+    invocation.leakPtr();
+
     threadID = static_cast<ThreadIdentifier>(threadIdentifier);
     storeThreadHandleByIdentifier(threadIdentifier, threadHandle);
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list