Window::~Window() is now in charge of calling deleteLater for all children
This commit is contained in:
@@ -78,8 +78,3 @@ ColorEdit::ColorEdit(FormGroup * parent, const rect_t & rect, std::function<uint
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
ColorEdit::~ColorEdit()
|
||||
{
|
||||
deleteChildren();
|
||||
}
|
||||
|
||||
@@ -32,8 +32,6 @@ class ColorEdit : public FormGroup {
|
||||
return "ColorEdit";
|
||||
}
|
||||
#endif
|
||||
|
||||
~ColorEdit() override;
|
||||
};
|
||||
|
||||
#endif // _COLOREDIT_H_
|
||||
|
||||
-5
@@ -85,11 +85,6 @@ class FormGroup: public FormField {
|
||||
{
|
||||
}
|
||||
|
||||
~FormGroup() override
|
||||
{
|
||||
deleteChildren(); // TODO move it to ~Window()
|
||||
}
|
||||
|
||||
#if defined(DEBUG_WINDOWS)
|
||||
std::string getName() override
|
||||
{
|
||||
|
||||
+2
-2
@@ -57,7 +57,7 @@ class MenuWindow: public Window {
|
||||
};
|
||||
|
||||
public:
|
||||
MenuWindow(Menu * parent);
|
||||
explicit MenuWindow(Menu * parent);
|
||||
|
||||
#if defined(DEBUG_WINDOWS)
|
||||
std::string getName() override
|
||||
@@ -126,7 +126,7 @@ class Menu : public Window {
|
||||
|
||||
~Menu() override
|
||||
{
|
||||
delete toolbar;
|
||||
menuWindow.detach();
|
||||
}
|
||||
|
||||
void setCancelHandler(std::function<void()> handler)
|
||||
|
||||
@@ -77,11 +77,6 @@ class MenuToolbar: public FormGroup {
|
||||
{
|
||||
}
|
||||
|
||||
~MenuToolbar() override
|
||||
{
|
||||
deleteChildren();
|
||||
}
|
||||
|
||||
void paint(BitmapBuffer * dc) override
|
||||
{
|
||||
dc->clear(DISABLE_COLOR);
|
||||
|
||||
+1
-1
@@ -46,7 +46,7 @@ Window::~Window()
|
||||
focusWindow = nullptr;
|
||||
}
|
||||
|
||||
// TODO deleteChildren(); (remove from FormGroup)
|
||||
deleteChildren();
|
||||
}
|
||||
|
||||
void Window::attach(Window * window)
|
||||
|
||||
Reference in New Issue
Block a user