mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-21 02:09:05 +02:00
Do the first CoInitializeEx on the main thread instead of the EmuThread (WASAPI). Fixes #7334
This commit is contained in:
1 parent
c8c80c0ced
commit
8a574e5cd2
4 files changed
+4
-5
No files matched your search
@@ -275,11 +275,9 @@ private:
|
||||
#define REFTIMES_PER_MILLISEC (REFTIMES_PER_SEC / 1000)
|
||||
|
||||
WASAPIAudioBackend::WASAPIAudioBackend() : hThread_(NULL), sampleRate_(0), callback_(nullptr), threadData_(0) {
|
||||
CoInitializeEx(NULL, COINIT_MULTITHREADED);
|
||||
}
|
||||
|
||||
WASAPIAudioBackend::~WASAPIAudioBackend() {
|
||||
CoUninitialize();
|
||||
if (threadData_ == 0) {
|
||||
threadData_ = 1;
|
||||
}
|
||||
|
||||
@@ -34,9 +34,7 @@ namespace W32Util
|
||||
wchar_t temp[MAX_PATH];
|
||||
SHGetPathFromIDList(idList, temp);
|
||||
if (wcslen(temp))
|
||||
{
|
||||
return ConvertWStringToUTF8(temp);
|
||||
}
|
||||
else
|
||||
return "";
|
||||
}
|
||||
|
||||
@@ -285,7 +285,7 @@ void WindowsHost::UpdateConsolePosition()
|
||||
HRESULT CreateLink(LPCWSTR lpszPathObj, LPCWSTR lpszArguments, LPCWSTR lpszPathLink, LPCWSTR lpszDesc) {
|
||||
HRESULT hres;
|
||||
IShellLink* psl;
|
||||
CoInitialize(0);
|
||||
CoInitializeEx(NULL, COINIT_MULTITHREADED);
|
||||
|
||||
// Get a pointer to the IShellLink interface. It is assumed that CoInitialize
|
||||
// has already been called.
|
||||
|
||||
@@ -359,6 +359,8 @@ int WINAPI WinMain(HINSTANCE _hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLin
|
||||
{
|
||||
setCurrentThreadName("Main");
|
||||
|
||||
CoInitializeEx(NULL, COINIT_MULTITHREADED);
|
||||
|
||||
// Windows Vista and above: alert Windows that PPSSPP is DPI aware,
|
||||
// so that we don't flicker in fullscreen on some PCs.
|
||||
MakePPSSPPDPIAware();
|
||||
@@ -616,5 +618,6 @@ int WINAPI WinMain(HINSTANCE _hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLin
|
||||
if (g_Config.bRestartRequired) {
|
||||
W32Util::ExitAndRestart();
|
||||
}
|
||||
CoUninitialize();
|
||||
return 0;
|
||||
}
|
||||
Reference in new issue
Block a user