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:
parent
20b443e011
commit
4254827b2c
1 changed files with 2 additions and 17 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue