while (root && !root->m_desktop)
{
root = root->m_parent;
+ if (!root)
+ return;
abspos += root->position();
}
assert(root->m_desktop);
m_parent = 0;
- /* destroy all childs */
+ /* tell all childs that the parent is not anymore existing */
ePtrList<eWidget>::iterator i(m_childs.begin());
while (i != m_childs.end())
{
- (*i)->m_parent = 0;
- delete *i;
+ (*i)->parentRemoved();
i = m_childs.erase(i);
}
}
} while(1);
}
+void eWidget::parentRemoved()
+{
+ m_parent = 0;
+}
+
int eWidget::event(int event, void *data, void *data2)
{
switch (event)