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