mirror of
https://github.com/optiscaler/OptiScaler.git
synced 2026-11-06 05:54:46 +00:00
Unhook createModel when needed
This commit is contained in:
1 parent
72b4edfd17
commit
ce255ccdfc
1 file changed
+12
-3
@@ -58,13 +58,22 @@ void FSR4ModelSelection::Hook(HMODULE module, bool unhookOld)
|
||||
if (module == nullptr)
|
||||
return;
|
||||
|
||||
if (o_getModelBlob != nullptr && unhookOld)
|
||||
if (unhookOld && (o_getModelBlob || o_createModel))
|
||||
{
|
||||
DetourTransactionBegin();
|
||||
DetourUpdateThread(GetCurrentThread());
|
||||
|
||||
DetourDetach(&(PVOID&) o_getModelBlob, hkgetModelBlob);
|
||||
o_getModelBlob = nullptr;
|
||||
if (o_getModelBlob != nullptr)
|
||||
{
|
||||
DetourDetach(&(PVOID&) o_getModelBlob, hkgetModelBlob);
|
||||
o_getModelBlob = nullptr;
|
||||
}
|
||||
|
||||
if (o_createModel != nullptr)
|
||||
{
|
||||
DetourDetach(&(PVOID&) o_createModel, hkcreateModel);
|
||||
o_createModel = nullptr;
|
||||
}
|
||||
|
||||
DetourTransactionCommit();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user