You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the case that InvokeNativeInternal happens to loop back to Invoke (calling a native in a native [callbacks]) it shouldn't call the GlobalCleanUp as it will be called as soon as that InvokeNativeInternal finishes, doing so would cleanup any resources (e.g. strings) before the original native finishes.
For example if we have a hook that has a string param and we call any native inside the hook, the string will become corrupted after that native call.
hook(string str){// str is valid
KickPlayer();// str is free'd [BAD]}
As discussed in https://discord.com/channels/1160907911501991946/1215025384752681081/1215026288151240704 calling a native in any callback called by native c++ will cleanup the global context resources which may be used by the callback itself.
In the case that
InvokeNativeInternal
happens to loop back toInvoke
(calling a native in a native [callbacks]) it shouldn't call theGlobalCleanUp
as it will be called as soon as thatInvokeNativeInternal
finishes, doing so would cleanup any resources (e.g. strings) before the original native finishes.For example if we have a hook that has a string param and we call any native inside the hook, the string will become corrupted after that native call.
CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/ScriptContext.cs
Lines 100 to 105 in 2eaf7c2
The text was updated successfully, but these errors were encountered: