From 6db3650d45da1df9879bd780dba6d8da2795dae9 Mon Sep 17 00:00:00 2001 From: amzn-sean <75276488+amzn-sean@users.noreply.github.com> Date: Wed, 23 Jun 2021 19:04:45 +0100 Subject: [PATCH] fix possible double connect of the Collider m_debugDisplayDataChangedEvent (#1518) Signed-off-by: John --- Gems/PhysX/Code/Editor/DebugDraw.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Gems/PhysX/Code/Editor/DebugDraw.cpp b/Gems/PhysX/Code/Editor/DebugDraw.cpp index 1f1c24b9ad..bd805cab4b 100644 --- a/Gems/PhysX/Code/Editor/DebugDraw.cpp +++ b/Gems/PhysX/Code/Editor/DebugDraw.cpp @@ -200,10 +200,8 @@ namespace PhysX void Collider::Disconnect() { - if (AzToolsFramework::ViewportInteraction::ViewportSettingsNotificationBus::Handler::BusIsConnected()) - { - AzToolsFramework::ViewportInteraction::ViewportSettingsNotificationBus::Handler::BusDisconnect(); - } + m_debugDisplayDataChangedEvent.Disconnect(); + AzToolsFramework::ViewportInteraction::ViewportSettingsNotificationBus::Handler::BusDisconnect(); AzToolsFramework::EntitySelectionEvents::Bus::Handler::BusDisconnect(); AzFramework::EntityDebugDisplayEventBus::Handler::BusDisconnect(); m_displayCallback = nullptr;