File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -158,13 +158,9 @@ namespace DirectX
158
158
159
159
IWICImagingFactory* _GetWIC ()
160
160
{
161
- static ComPtr<IWICImagingFactory> s_Factory;
162
-
163
- if ( s_Factory )
164
- return s_Factory.Get ();
165
-
166
161
static INIT_ONCE s_initOnce = INIT_ONCE_STATIC_INIT;
167
162
163
+ IWICImagingFactory* factory = nullptr ;
168
164
InitOnceExecuteOnce (&s_initOnce,
169
165
[](PINIT_ONCE, PVOID, PVOID *factory) -> BOOL
170
166
{
@@ -202,9 +198,9 @@ namespace DirectX
202
198
__uuidof (IWICImagingFactory),
203
199
factory) ) ? TRUE : FALSE ;
204
200
#endif
205
- }, nullptr , reinterpret_cast <LPVOID*>(s_Factory. GetAddressOf () ));
201
+ }, nullptr , reinterpret_cast <LPVOID*>(&factory ));
206
202
207
- return s_Factory. Get () ;
203
+ return factory ;
208
204
}
209
205
210
206
} // namespace DirectX
You can’t perform that action at this time.
0 commit comments