Fix up incorrect autoDelete use and handling.
Several UI property handlers were incorrectly using the autoDelete feature by calling UnregisterPropertyType and deleting the pointer themselves, which caused double-delete crashes on application shutdown. PropertyManagerComponent now gracefully handles that condition but also explicitly asserts explaining how the code should be changed, and the "known offenders" have been fixed up to use autoDelete correctly.
This commit is contained in:
@@ -236,17 +236,11 @@ namespace ScriptEventsEditor
|
||||
moduleConfiguration->RegisterAssetHandler();
|
||||
}
|
||||
|
||||
m_propertyHandlers.emplace_back(AzToolsFramework::RegisterGenericComboBoxHandler<ScriptEventData::VersionedProperty>());
|
||||
AzToolsFramework::RegisterGenericComboBoxHandler<ScriptEventData::VersionedProperty>();
|
||||
}
|
||||
|
||||
void ScriptEventEditorSystemComponent::Deactivate()
|
||||
{
|
||||
for (auto&& propertyHandler : m_propertyHandlers)
|
||||
{
|
||||
AzToolsFramework::PropertyTypeRegistrationMessages::Bus::Broadcast(&AzToolsFramework::PropertyTypeRegistrationMessages::UnregisterPropertyType, propertyHandler.get());
|
||||
}
|
||||
m_propertyHandlers.clear();
|
||||
|
||||
using namespace ScriptEvents;
|
||||
ScriptEventsSystemComponentImpl* moduleConfiguration = nullptr;
|
||||
ScriptEventModuleConfigurationRequestBus::BroadcastResult(moduleConfiguration, &ScriptEventModuleConfigurationRequests::GetSystemComponentImpl);
|
||||
|
||||
Reference in New Issue
Block a user