mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-23 21:56:22 +00:00
Revert "chore(Debug/Scripting): improve debug errors during the unloading scripts (#19643)" (#19951)
This reverts commit db7183a573.
*wrongly use to catch sigsegv
*null check isn't necessary: https://en.cppreference.com/w/cpp/memory/new/operator_delete
This commit is contained in:
@@ -30,24 +30,9 @@ namespace
|
||||
template<typename T>
|
||||
inline void SCR_CLEAR()
|
||||
{
|
||||
for (auto& [scriptID, script] : ScriptRegistry<T>::ScriptPointerList)
|
||||
for (auto const& [scriptID, script] : ScriptRegistry<T>::ScriptPointerList)
|
||||
{
|
||||
try
|
||||
{
|
||||
if(script)
|
||||
{
|
||||
delete script;
|
||||
script = nullptr;
|
||||
}
|
||||
}
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
LOG_ERROR("scripts.unloading", "Failed to unload script {} with ID: {}. Error: {}", script->GetName(), scriptID, e.what());
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
LOG_ERROR("scripts.unloading", "Failed to unload script {} with ID: {}. Unknown error occurred.", script->GetName(), scriptID);
|
||||
}
|
||||
delete script;
|
||||
}
|
||||
|
||||
ScriptRegistry<T>::ScriptPointerList.clear();
|
||||
|
||||
Reference in New Issue
Block a user