Fix various problems with unloading ClientPrefs and SourceMod (bug 5874, r=ds).
--HG-- extra : rebase_source : 0a35f8380d651ca65fac9dd402c5cd3625e3105c
This commit is contained in:
+14
-2
@@ -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()
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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. */
|
||||
|
||||
Reference in New Issue
Block a user