From: Felix Domke Date: Sat, 17 Dec 2005 16:00:50 +0000 (+0000) Subject: GUI: child windows will no long be removed on parent destroy. listbox/window now... X-Git-Tag: 2.6.0~4679 X-Git-Url: https://git.cweiske.de/enigma2.git/commitdiff_plain/7eab308715ea1130166915574e3b691e08eb4482 GUI: child windows will no long be removed on parent destroy. listbox/window now destroy their private parents. python does no longer use thisown = 0. --- diff --git a/lib/gui/elistbox.cpp b/lib/gui/elistbox.cpp index 013a3103..21394de5 100644 --- a/lib/gui/elistbox.cpp +++ b/lib/gui/elistbox.cpp @@ -20,6 +20,9 @@ eListbox::eListbox(eWidget *parent) eListbox::~eListbox() { + if (m_scrollbar) + delete m_scrollbar; + ePtr ptr; eActionMap::getInstance(ptr); ptr->unbindAction(this, 0); diff --git a/lib/gui/ewidget.cpp b/lib/gui/ewidget.cpp index 023caa6a..6f7fa91b 100644 --- a/lib/gui/ewidget.cpp +++ b/lib/gui/ewidget.cpp @@ -205,12 +205,11 @@ eWidget::~eWidget() m_parent = 0; - /* destroy all childs */ + /* tell all childs that the parent is not anymore existing */ ePtrList::iterator i(m_childs.begin()); while (i != m_childs.end()) { - (*i)->m_parent = 0; - delete *i; + (*i)->parentRemoved(); i = m_childs.erase(i); } } @@ -275,6 +274,11 @@ void eWidget::recalcClipRegionsWhenVisible() } while(1); } +void eWidget::parentRemoved() +{ + m_parent = 0; +} + int eWidget::event(int event, void *data, void *data2) { switch (event) diff --git a/lib/gui/ewidget.h b/lib/gui/ewidget.h index db86fd10..6739f25e 100644 --- a/lib/gui/ewidget.h +++ b/lib/gui/ewidget.h @@ -72,6 +72,8 @@ private: void doPaint(gPainter &painter, const gRegion ®ion); void recalcClipRegionsWhenVisible(); + void parentRemoved(); + gRGB m_background_color; int m_have_background_color; diff --git a/lib/gui/ewindow.cpp b/lib/gui/ewindow.cpp index 54a35958..06827a9e 100644 --- a/lib/gui/ewindow.cpp +++ b/lib/gui/ewindow.cpp @@ -33,6 +33,7 @@ eWindow::eWindow(eWidgetDesktop *desktop): eWidget(0) eWindow::~eWindow() { getDesktop()->removeRootWidget(this); + m_child->destruct(); } void eWindow::setTitle(const std::string &string) diff --git a/lib/python/Components/GUISkin.py b/lib/python/Components/GUISkin.py index c953aaec..cf8e1894 100644 --- a/lib/python/Components/GUISkin.py +++ b/lib/python/Components/GUISkin.py @@ -16,7 +16,7 @@ class GUISkin: for w in self.additionalWidgets: w.instance = w.widget(parent) - w.instance.thisown = 0 + # w.instance.thisown = 0 applyAllAttributes(w.instance, desktop, w.skinAttributes) for f in self.onLayoutFinish: