Core/Scripting: Fix acquiring of references between script swaps

* Delay unloading of shared libraries to the next update tick
  to prevent crashes in the destructor of the last referenced
  script instance.
* Closes #17557
This commit is contained in:
Naios authored and Aokromes committed 2016-08-10 09:05:43 +02:00
1 parent a354feb48b
commit efa3d00ebf
3 files changed
+55 -14

No files matched your search

+3
View File
@@ -879,6 +879,9 @@ class TC_GAME_API ScriptMgr
/// calls for better performance (bulk changes).
void SwapScriptContext(bool initialize = false);
/// Returns the context name of the static context provided by the worldserver
static std::string const& GetNameOfStaticContext();
/// Acquires a strong module reference to the module containing the given script name,
/// which prevents the shared library which contains the script from unloading.
/// The shared library is lazy unloaded as soon as all references to it are released.