mirror of
https://gitlab.com/Mr_Goldberg/goldberg_emulator.git
synced 2025-12-05 11:44:53 +01:00
Use LoadLibrary instead of LoadModule
LoadLibrary increase the reference count to the library. So we make sure this library is still loaded when we shut down the hook.
This commit is contained in:
parent
fdeb5912d3
commit
f096a2d8a2
7 changed files with 27 additions and 24 deletions
|
|
@ -115,7 +115,7 @@ OpenGL_Hook::OpenGL_Hook():
|
|||
initialized(false),
|
||||
wglSwapBuffers(nullptr)
|
||||
{
|
||||
_dll = GetModuleHandle(DLL_NAME);
|
||||
_library = LoadLibrary(DLL_NAME);
|
||||
// Hook to wglMakeCurrent so we know when it gets called.
|
||||
// If its called, then OpenGL will be used to render the overlay.
|
||||
//wglMakeCurrent = (decltype(wglMakeCurrent))GetProcAddress(_dll, "wglMakeCurrent");
|
||||
|
|
@ -132,12 +132,9 @@ OpenGL_Hook::~OpenGL_Hook()
|
|||
{
|
||||
PRINT_DEBUG("OpenGL Hook removed\n");
|
||||
|
||||
if (_hooked)
|
||||
{
|
||||
ImGui_ImplOpenGL3_Shutdown();
|
||||
ImGui_ImplWin32_Shutdown();
|
||||
ImGui::DestroyContext();
|
||||
}
|
||||
resetRenderState();
|
||||
|
||||
FreeLibrary(reinterpret_cast<HMODULE>(_library));
|
||||
|
||||
_inst = nullptr;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue