Преглед изворни кода

Make sure to actually remove the signal registration too

JeffR пре 1 месец
родитељ
комит
c2a46e4b45
2 измењених фајлова са 10 додато и 0 уклоњено
  1. 9 0
      Engine/source/gui/utility/guiInputCtrl.cpp
  2. 1 0
      Engine/source/gui/utility/guiInputCtrl.h

+ 9 - 0
Engine/source/gui/utility/guiInputCtrl.cpp

@@ -95,6 +95,15 @@ bool GuiInputCtrl::onAdd()
       return false;
       return false;
 
 
    GuiCanvas::getCanvasSetActiveSignal().notify(this, &GuiInputCtrl::handleCanvasSetActive);
    GuiCanvas::getCanvasSetActiveSignal().notify(this, &GuiInputCtrl::handleCanvasSetActive);
+
+   return true;
+}
+
+void GuiInputCtrl::onRemove()
+{
+   GuiCanvas::getCanvasSetActiveSignal().remove(this, &GuiInputCtrl::handleCanvasSetActive);
+
+   Parent::onRemove();
 }
 }
 
 
 bool GuiInputCtrl::onWake()
 bool GuiInputCtrl::onWake()

+ 1 - 0
Engine/source/gui/utility/guiInputCtrl.h

@@ -48,6 +48,7 @@ public:
    GuiInputCtrl();
    GuiInputCtrl();
 
 
    bool onAdd() override;
    bool onAdd() override;
+   void onRemove() override;
 
 
    // GuiControl.
    // GuiControl.
    bool onWake() override;
    bool onWake() override;