Skip to content

Commit 8fb1548

Browse files
committed
Reorganized CSourcePython::Unload()
1 parent 0728de9 commit 8fb1548

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/core/sp_main.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -257,15 +257,18 @@ bool CSourcePython::Load( CreateInterfaceFn interfaceFactory, CreateInterfaceFn
257257
void CSourcePython::Unload( void )
258258
{
259259
Msg(MSG_PREFIX "Unloading...\n");
260+
261+
DevMsg(1, MSG_PREFIX "Unhooking all functions...\n");
262+
GetHookManager()->UnhookAllFunctions();
263+
264+
DevMsg(1, MSG_PREFIX "Shutting down python...\n");
265+
g_PythonManager.Shutdown();
260266

261267
DevMsg(1, MSG_PREFIX "Clearing all commands...\n");
262268
ClearAllCommands();
263269

264270
DevMsg(1, MSG_PREFIX "Unregistering ConVar...\n");
265271
ConVar_Unregister( );
266-
267-
DevMsg(1, MSG_PREFIX "Shutting down python...\n");
268-
g_PythonManager.Shutdown();
269272

270273
// New in CSGO...
271274
#ifdef ENGINE_CSGO
@@ -278,9 +281,6 @@ void CSourcePython::Unload( void )
278281
DevMsg(1, MSG_PREFIX "Disconnecting tier1 libraries...\n");
279282
DisconnectTier1Libraries( );
280283
#endif
281-
282-
DevMsg(1, MSG_PREFIX "Unhooking all functions...\n");
283-
GetHookManager()->UnhookAllFunctions();
284284

285285
Msg(MSG_PREFIX "Unloaded successfully.\n");
286286
}

0 commit comments

Comments
 (0)