Fix various problems with unloading ClientPrefs and SourceMod (bug 5874, r=ds).

--HG--
extra : rebase_source : 0a35f8380d651ca65fac9dd402c5cd3625e3105c
This commit is contained in:
David Anderson
2013-08-22 14:05:44 -07:00
parent d79b41e4a7
commit 94d33a4ef1
17 changed files with 195 additions and 183 deletions
+14 -2
View File
@@ -1,5 +1,5 @@
/**
* vim: set ts=4 :
* vim: set ts=4 sw=4 tw=99 noet:
* =============================================================================
* SourceMod
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
@@ -134,8 +134,9 @@ namespace SourceMod
* itself is not versioned.
*
* V6 - added TestFeature() to IShareSys.
* V7 - added OnDependenciesDropped() to IExtensionInterface.
*/
#define SMINTERFACE_EXTENSIONAPI_VERSION 6
#define SMINTERFACE_EXTENSIONAPI_VERSION 7
/**
* @brief The interface an extension must expose.
@@ -313,6 +314,17 @@ namespace SourceMod
virtual void OnCoreMapStart(edict_t *pEdictList, int edictCount, int clientMax)
{
}
/**
* @brief Called once all dependencies have been unloaded. This is
* called AFTER OnExtensionUnload(), but before the extension library
* has been unloaded. It can be used as an alternate unload hook for
* cases where having no dependent plugins would make shutdown much
* simplier.
*/
virtual void OnDependenciesDropped()
{
}
};
/**
+10 -1
View File
@@ -1,5 +1,5 @@
/**
* vim: set ts=4 :
* vim: set ts=4 sw=4 tw=99 noet:
* =============================================================================
* SourceMod Base Extension Code
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
@@ -239,6 +239,11 @@ void SDKExtension::OnExtensionUnload()
SDK_OnUnload();
}
void SDKExtension::OnDependenciesDropped()
{
SDK_OnDependenciesDropped();
}
const char *SDKExtension::GetExtensionAuthor()
{
return SMEXT_CONF_AUTHOR;
@@ -291,6 +296,10 @@ void SDKExtension::SDK_OnAllLoaded()
{
}
void SDKExtension::SDK_OnDependenciesDropped()
{
}
#if defined SMEXT_CONF_METAMOD
PluginId g_PLID = 0; /**< Metamod plugin ID */
+11 -2
View File
@@ -1,5 +1,5 @@
/**
* vim: set ts=4 :
* vim: set ts=4 sw=4 tw=99 noet:
* =============================================================================
* SourceMod Base Extension Code
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
@@ -127,7 +127,7 @@ public:
virtual bool SDK_OnLoad(char *error, size_t maxlength, bool late);
/**
* @brief This is called right before the extension is unloaded.
* @brief This is called once the extension unloading process begins.
*/
virtual void SDK_OnUnload();
@@ -141,6 +141,12 @@ public:
*/
virtual void SDK_OnPauseChange(bool paused);
/**
* @brief Called after SDK_OnUnload, once all dependencies have been
* removed, and the extension is about to be removed from memory.
*/
virtual void SDK_OnDependenciesDropped();
#if defined SMEXT_CONF_METAMOD
/**
* @brief Called when Metamod is attached, before the extension version is called.
@@ -203,6 +209,9 @@ public: //IExtensionInterface
virtual const char *GetExtensionDescription();
/** Returns date string */
virtual const char *GetExtensionDateString();
/** Called after OnExtensionUnload, once dependencies have been dropped. */
virtual void OnDependenciesDropped();
#if defined SMEXT_CONF_METAMOD
public: //ISmmPlugin
/** Called when the extension is attached to Metamod. */