summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorwithmorten <morten.with@gmail.com>2020-08-07 18:21:05 +0200
committerwithmorten <morten.with@gmail.com>2020-08-07 18:52:33 +0200
commitce0633a0c2370ad0e075ca5ae0a65bc7061cc65d (patch)
treefef81f3d6b95c280f40e30ecacf51c26e81f1f79 /src
parentMerge pull request #679 from ShFil119/actions (diff)
downloadre3-ce0633a0c2370ad0e075ca5ae0a65bc7061cc65d.tar
re3-ce0633a0c2370ad0e075ca5ae0a65bc7061cc65d.tar.gz
re3-ce0633a0c2370ad0e075ca5ae0a65bc7061cc65d.tar.bz2
re3-ce0633a0c2370ad0e075ca5ae0a65bc7061cc65d.tar.lz
re3-ce0633a0c2370ad0e075ca5ae0a65bc7061cc65d.tar.xz
re3-ce0633a0c2370ad0e075ca5ae0a65bc7061cc65d.tar.zst
re3-ce0633a0c2370ad0e075ca5ae0a65bc7061cc65d.zip
Diffstat (limited to 'src')
-rw-r--r--src/skel/win/win.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/skel/win/win.cpp b/src/skel/win/win.cpp
index 5c5c7ece..6d44ce80 100644
--- a/src/skel/win/win.cpp
+++ b/src/skel/win/win.cpp
@@ -1851,7 +1851,11 @@ void PlayMovieInWindow(int cmdShow, const char* szFile)
MultiByteToWideChar(CP_ACP, 0, szFile, -1, wFileName, sizeof(wFileName) - 1);
// Initialize COM
+#ifdef FIX_BUGS // will also return S_FALSE if it has already been inited in the same thread
+ CoInitialize(nil);
+#else
JIF(CoInitialize(nil));
+#endif
// Get the interface for DirectShow's GraphBuilder
JIF(CoCreateInstance(CLSID_FilterGraph, nil, CLSCTX_INPROC,
@@ -2225,7 +2229,9 @@ WinMain(HINSTANCE instance,
{
CloseClip();
- CoUninitialize();
+#ifndef FIX_BUGS
+ CoUninitialize(); // CoUninitialize should only be called at the shutdown of a program, and by then it doesn't matter
+#endif
if ( CMenuManager::OS_Language == LANG_FRENCH || CMenuManager::OS_Language == LANG_GERMAN )
PlayMovieInWindow(cmdShow, "movies\\GTAtitlesGER.mpg");
@@ -2260,7 +2266,9 @@ WinMain(HINSTANCE instance,
case GS_INIT_ONCE:
{
CloseClip();
- CoUninitialize();
+#ifndef FIX_BUGS
+ CoUninitialize(); // CoUninitialize should only be called at the shutdown of a program, and by then it doesn't matter
+#endif
#ifdef FIX_BUGS
// draw one frame because otherwise we'll end up looking at black screen for a while if vsync is on