Merge pull request #7991 from krzys-h/com-init-again

Fix COM initialization on Qt builds
This commit is contained in:
Twinaphex 2019-01-12 15:21:58 +01:00 committed by GitHub
commit 700829b5d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -36,6 +36,11 @@
#include "../driver.h"
#include "../paths.h"
#include "../retroarch.h"
#include "../verbosity.h"
#if defined(_WIN32) && !defined(_XBOX) && !defined(__WINRT__)
#include <objbase.h>
#endif
/* griffin hack */
#ifdef HAVE_QT
@ -44,15 +49,6 @@
#endif
#endif
#ifndef HAVE_MAIN
#include "../retroarch.h"
#include "../verbosity.h"
#if defined(_WIN32) && !defined(_XBOX) && !defined(__WINRT__)
#include <objbase.h>
#endif
#endif
/**
* main_exit:
*
@ -94,6 +90,10 @@ void main_exit(void *args)
driver_ctl(RARCH_DRIVER_CTL_DEINIT, NULL);
ui_companion_driver_free();
frontend_driver_free();
#if defined(_WIN32) && !defined(_XBOX) && !defined(__WINRT__)
CoUninitialize();
#endif
}
/**
@ -114,7 +114,7 @@ int rarch_main(int argc, char *argv[], void *data)
const ui_application_t *ui_application = NULL;
#endif
#if !defined(HAVE_MAIN) && defined(_WIN32) && !defined(_XBOX) && !defined(__WINRT__)
#if defined(_WIN32) && !defined(_XBOX) && !defined(__WINRT__)
if (FAILED(CoInitialize(NULL)))
{
RARCH_ERR("FATAL: Failed to initialize the COM interface\n");
@ -170,10 +170,6 @@ int rarch_main(int argc, char *argv[], void *data)
ui_application->run(args);
#endif
#if !defined(HAVE_MAIN) && defined(_WIN32) && !defined(_XBOX) && !defined(__WINRT__)
CoUninitialize();
#endif
return 0;
}