Skip to content

Commit

Permalink
Reset interface pointers on unload (#54)
Browse files Browse the repository at this point in the history
* Fixes a crash when sdkhooks or bintools or sdktools are unloaded.
  • Loading branch information
MAGNAT2645 authored Jun 27, 2024
1 parent b6d82c3 commit 10fb154
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion extension/extension.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,14 +259,17 @@ bool CBaseNPCExt::QueryRunning(char* error, size_t maxlength) {

bool CBaseNPCExt::QueryInterfaceDrop(SMInterface* interface) {
if (interface == g_pBinTools) {
g_pBinTools = nullptr;
return false;
}

if (interface == g_pSDKHooks) {
g_pSDKHooks = nullptr;
return false;
}

if (interface == g_pSDKTools) {
g_pSDKTools = nullptr;
return false;
}

Expand Down Expand Up @@ -330,4 +333,4 @@ float UTIL_VecToYaw(const Vector& vec) {
}

return yaw;
}
}
2 changes: 1 addition & 1 deletion product.version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.11.1
1.11.2

0 comments on commit 10fb154

Please sign in to comment.