mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
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
(cherry picked from commit 445746c402)
This commit is contained in:
@@ -875,6 +875,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.
|
||||
|
||||
Reference in New Issue
Block a user