Explicitly initialize COM with multi-threaded support.
authorSam Lantinga <slouken@libsdl.org>
Mon, 23 Dec 2013 10:54:27 -0800
changeset 8065fcca53e02c81
parent 8064 ac809ea54d63
child 8066 658b461d81be
Explicitly initialize COM with multi-threaded support.
This is the safest option for applications that use COM, multi-threaded or not.
src/core/windows/SDL_windows.c
     1.1 --- a/src/core/windows/SDL_windows.c	Mon Dec 16 10:03:26 2013 -0300
     1.2 +++ b/src/core/windows/SDL_windows.c	Mon Dec 23 10:54:27 2013 -0800
     1.3 @@ -45,7 +45,7 @@
     1.4  HRESULT
     1.5  WIN_CoInitialize(void)
     1.6  {
     1.7 -    const HRESULT hr = CoInitialize(NULL);
     1.8 +    const HRESULT hr = CoInitializeEx(NULL, COINIT_MULTITHREADED);
     1.9  
    1.10      /* S_FALSE means success, but someone else already initialized. */
    1.11      /* You still need to call CoUninitialize in this case! */