Revert "win-capture: Don't leak dynamic library references"
This reverts commit c5928bff4a96977b220027c067ac6b9335b6b4e2. This breaks game capture.
This commit is contained in:
parent
021defd962
commit
d981c10906
@ -56,7 +56,6 @@ static inline bool dxgi_init(dxgi_info &info)
|
||||
create = (d3d10create_t)GetProcAddress(d3d10_module,
|
||||
"D3D10CreateDeviceAndSwapChain");
|
||||
if (!create) {
|
||||
FreeLibrary(d3d10_module);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -65,14 +64,12 @@ static inline bool dxgi_init(dxgi_info &info)
|
||||
|
||||
hr = create_factory(&factory_iid, (void **)&factory);
|
||||
if (FAILED(hr)) {
|
||||
FreeLibrary(d3d10_module);
|
||||
return false;
|
||||
}
|
||||
|
||||
hr = factory->EnumAdapters1(0, &adapter);
|
||||
factory->Release();
|
||||
if (FAILED(hr)) {
|
||||
FreeLibrary(d3d10_module);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -90,12 +87,10 @@ static inline bool dxgi_init(dxgi_info &info)
|
||||
D3D10_SDK_VERSION, &desc, &info.swap, &device);
|
||||
adapter->Release();
|
||||
if (FAILED(hr)) {
|
||||
FreeLibrary(d3d10_module);
|
||||
return false;
|
||||
}
|
||||
|
||||
device->Release();
|
||||
FreeLibrary(d3d10_module);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -113,7 +113,6 @@ int inject_library_safe_obf(DWORD thread_id, const wchar_t *dll,
|
||||
size_t i;
|
||||
|
||||
if (!lib || !user32) {
|
||||
FreeLibrary(lib);
|
||||
return INJECT_ERROR_UNLIKELY_FAIL;
|
||||
}
|
||||
|
||||
@ -124,7 +123,6 @@ int inject_library_safe_obf(DWORD thread_id, const wchar_t *dll,
|
||||
#endif
|
||||
|
||||
if (!proc) {
|
||||
FreeLibrary(lib);
|
||||
return INJECT_ERROR_UNLIKELY_FAIL;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user