Reviewed by Oliver Hunt.
authorap@webkit.org <ap@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Jan 2009 14:50:54 +0000 (14:50 +0000)
committerap@webkit.org <ap@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Jan 2009 14:50:54 +0000 (14:50 +0000)
        https://bugs.webkit.org/show_bug.cgi?id=23459
        Workers are not properly terminated if execution hasn't begun yet

        Doesn't affect observable behavior, so test case is not possible.

        * dom/WorkerThread.cpp: (WebCore::WorkerThread::workerThread): Call forbidExecution() if
        it couldn't be called earlier.

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

WebCore/ChangeLog
WebCore/dom/WorkerThread.cpp

index ceb4dcc..b3dedd0 100644 (file)
@@ -1,3 +1,15 @@
+2009-01-23  Alexey Proskuryakov  <ap@webkit.org>
+
+        Reviewed by Oliver Hunt.
+
+        https://bugs.webkit.org/show_bug.cgi?id=23459
+        Workers are not properly terminated if execution hasn't begun yet
+
+        Doesn't affect observable behavior, so test case is not possible.
+
+        * dom/WorkerThread.cpp: (WebCore::WorkerThread::workerThread): Call forbidExecution() if
+        it couldn't be called earlier.
+
 2009-01-23  Ariya Hidayat  <ariya.hidayat@trolltech.com>
 
         [Qt] Fix the build after RenderBox refactoring in r40153.
index d2c4933..b50f131 100644 (file)
@@ -103,6 +103,11 @@ void* WorkerThread::workerThread()
     {
         MutexLocker lock(m_threadCreationMutex);
         m_workerContext = WorkerContext::create(m_startupData->m_scriptURL, m_startupData->m_userAgent, this);
+        if (m_messageQueue.killed()) {
+            // The worker was terminated before the thread had a chance to run. Since the context didn't exist yet, 
+            // forbidExecution() couldn't be called from stop().
+           m_workerContext->script()->forbidExecution();
+        }
     }
 
     WorkerScriptController* script = m_workerContext->script();