File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change 6161#include " modules/entities/entities_entity.h"
6262#include " modules/core/core.h"
6363
64+ #ifdef _WIN32
65+ #include " Windows.h"
66+ #endif
67+
6468
6569// -----------------------------------------------------------------------------
6670// Disable warnings.
@@ -374,6 +378,9 @@ void CSourcePython::Unload( void )
374378 DevMsg (1 , MSG_PREFIX " Restoring old logging state...\n " );
375379 LoggingSystem_PopLoggingState (false );
376380#endif
381+
382+ DevMsg (1 , MSG_PREFIX " Resetting cache notifier...\n " );
383+ modelcache->SetCacheNotify (m_pOldMDLCacheNotifier);
377384
378385 DevMsg (1 , MSG_PREFIX " Shutting down python...\n " );
379386 g_PythonManager.Shutdown ();
@@ -396,10 +403,12 @@ void CSourcePython::Unload( void )
396403 DisconnectTier1Libraries ( );
397404#endif
398405
399- DevMsg (1 , MSG_PREFIX " Resetting cache notifier...\n " );
400- modelcache->SetCacheNotify (m_pOldMDLCacheNotifier);
401-
402406 Msg (MSG_PREFIX " Unloaded successfully.\n " );
407+
408+ #ifdef _WIN32
409+ // This "fixes" a crash after SP has been unloaded.
410+ Sleep (1000 );
411+ #endif
403412}
404413
405414// -----------------------------------------------------------------------------
You can’t perform that action at this time.
0 commit comments