]> git.sesse.net Git - vlc/blobdiff - projects/activex/connectioncontainer.cpp
activex: stop processing events on closing ActiveX plugin
[vlc] / projects / activex / connectioncontainer.cpp
index fbceb7e450e30891ce2f1a03858cac926cb719fa..91fd0b6ce2a1bfe5154ae82ce75a49b7b3699124 100644 (file)
@@ -163,10 +163,17 @@ DWORD WINAPI ThreadProcEventHandler(LPVOID lpParam)
             pCPC->_q_events.pop();
             pCPC->_p_events->fireEvent(ev->_dispId, &ev->_dispParams);
             delete ev;
+
+
+            if (!pCPC->isRunning)
+            {
+                LeaveCriticalSection(&(pCPC->csEvents));
+                goto out;
+            }
         }
         LeaveCriticalSection(&(pCPC->csEvents));
     }
-
+out:
     CoUninitialize();
     return 0;
 }