mirror of
https://github.com/microsoft/DirectXTex
synced 2024-11-21 20:10:05 +00:00
Fixed crash on exit for Win32
This commit is contained in:
parent
0bbee8c588
commit
fd11ad4533
@ -701,13 +701,9 @@ namespace
|
||||
|
||||
IWICImagingFactory* _GetWIC()
|
||||
{
|
||||
static ComPtr<IWICImagingFactory> s_Factory;
|
||||
|
||||
if ( s_Factory )
|
||||
return s_Factory.Get();
|
||||
|
||||
static INIT_ONCE s_initOnce = INIT_ONCE_STATIC_INIT;
|
||||
|
||||
IWICImagingFactory* factory = nullptr;
|
||||
InitOnceExecuteOnce(&s_initOnce,
|
||||
[](PINIT_ONCE, PVOID, PVOID *factory) -> BOOL
|
||||
{
|
||||
@ -745,9 +741,9 @@ namespace
|
||||
__uuidof(IWICImagingFactory),
|
||||
factory) ) ? TRUE : FALSE;
|
||||
#endif
|
||||
}, nullptr, reinterpret_cast<LPVOID*>(s_Factory.GetAddressOf()));
|
||||
}, nullptr, reinterpret_cast<LPVOID*>(&factory));
|
||||
|
||||
return s_Factory.Get();
|
||||
return factory;
|
||||
}
|
||||
} // anonymous namespace
|
||||
|
||||
|
@ -781,13 +781,9 @@ namespace
|
||||
|
||||
IWICImagingFactory2* _GetWIC()
|
||||
{
|
||||
static ComPtr<IWICImagingFactory2> s_Factory;
|
||||
|
||||
if ( s_Factory )
|
||||
return s_Factory.Get();
|
||||
|
||||
static INIT_ONCE s_initOnce = INIT_ONCE_STATIC_INIT;
|
||||
|
||||
IWICImagingFactory2* factory = nullptr;
|
||||
(void)InitOnceExecuteOnce(&s_initOnce,
|
||||
[](PINIT_ONCE, PVOID, PVOID *factory) -> BOOL
|
||||
{
|
||||
@ -797,9 +793,9 @@ namespace
|
||||
CLSCTX_INPROC_SERVER,
|
||||
__uuidof(IWICImagingFactory2),
|
||||
factory) ) ? TRUE : FALSE;
|
||||
}, nullptr, reinterpret_cast<LPVOID*>(s_Factory.GetAddressOf()));
|
||||
}, nullptr, reinterpret_cast<LPVOID*>(&factory));
|
||||
|
||||
return s_Factory.Get();
|
||||
return factory;
|
||||
}
|
||||
} // anonymous namespace
|
||||
|
||||
|
@ -168,13 +168,9 @@ namespace
|
||||
//--------------------------------------------------------------------------------------
|
||||
IWICImagingFactory* _GetWIC()
|
||||
{
|
||||
static ComPtr<IWICImagingFactory> s_Factory;
|
||||
|
||||
if ( s_Factory )
|
||||
return s_Factory.Get();
|
||||
|
||||
static INIT_ONCE s_initOnce = INIT_ONCE_STATIC_INIT;
|
||||
|
||||
IWICImagingFactory* factory = nullptr;
|
||||
InitOnceExecuteOnce(&s_initOnce,
|
||||
[](PINIT_ONCE, PVOID, PVOID *factory) -> BOOL
|
||||
{
|
||||
@ -212,9 +208,9 @@ namespace
|
||||
__uuidof(IWICImagingFactory),
|
||||
factory) ) ? TRUE : FALSE;
|
||||
#endif
|
||||
}, nullptr, reinterpret_cast<LPVOID*>(s_Factory.GetAddressOf()));
|
||||
}, nullptr, reinterpret_cast<LPVOID*>(&factory));
|
||||
|
||||
return s_Factory.Get();
|
||||
return factory;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------
|
||||
|
@ -149,13 +149,9 @@ namespace
|
||||
|
||||
IWICImagingFactory2* _GetWIC()
|
||||
{
|
||||
static ComPtr<IWICImagingFactory2> s_Factory;
|
||||
|
||||
if ( s_Factory )
|
||||
return s_Factory.Get();
|
||||
|
||||
static INIT_ONCE s_initOnce = INIT_ONCE_STATIC_INIT;
|
||||
|
||||
IWICImagingFactory2* factory = nullptr;
|
||||
(void)InitOnceExecuteOnce(&s_initOnce,
|
||||
[](PINIT_ONCE, PVOID, PVOID *factory) -> BOOL
|
||||
{
|
||||
@ -165,9 +161,9 @@ namespace
|
||||
CLSCTX_INPROC_SERVER,
|
||||
__uuidof(IWICImagingFactory2),
|
||||
factory) ) ? TRUE : FALSE;
|
||||
}, nullptr, reinterpret_cast<LPVOID*>(s_Factory.GetAddressOf()));
|
||||
}, nullptr, reinterpret_cast<LPVOID*>(&factory));
|
||||
|
||||
return s_Factory.Get();
|
||||
return factory;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user