]> git.sesse.net Git - vlc/commit
Win32: correct the 'one-instance' deallocation code
authorErwan Tulou <erwan10@videolan.org>
Wed, 27 Jan 2010 22:08:38 +0000 (23:08 +0100)
committerErwan Tulou <erwan10@videolan.org>
Wed, 27 Jan 2010 22:17:13 +0000 (23:17 +0100)
commit1441dee2edebf99e6acb64450418389b8a7bba4c
tree80a6dffef57ad5d1b0d64436a3bd528c1448dd3f
parent66852fb38b7e4848cee9cd135db23284a3b99d77
Win32: correct the 'one-instance' deallocation code

'one-instance' happens to work on Win32 though there are several issues:
- a WM_QUIT is sent to the helper thread when any instance terminates
 (the master or a secondary instance). 'one-instance' should then stop
 working as soon as the first secondary instance terminates.
- But, sending WM_QUIT via SendMessage directly calls the window
procedure callback. And this callback here doesn't process the message
at all. Therefore, it is a no-op and the thread is actually never stopped.

This patch does the following :
- move the WM_QUIT message to ensure that only the master (first) instance
 stops the helper thread.
- process the WM_QUIT message in the window procedure callback, and call
for clean termination of the thread.

Note that PostQuitMessage cannot be directly called as there are two
distincts threads here.
src/win32/specific.c