git.cweiske.de
/
enigma2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix memleak when call of convertFunc failes
[enigma2.git]
/
lib
/
gui
/
ewidget.cpp
diff --git
a/lib/gui/ewidget.cpp
b/lib/gui/ewidget.cpp
index 023caa6a7e90341c4c3c6c0739a25da673835c5f..3bc6e663841e940e1d7506f7baf4722c90f01a24 100644
(file)
--- a/
lib/gui/ewidget.cpp
+++ b/
lib/gui/ewidget.cpp
@@
-140,6
+140,8
@@
void eWidget::hide()
while (root && !root->m_desktop)
{
root = root->m_parent;
while (root && !root->m_desktop)
{
root = root->m_parent;
+ if (!root)
+ return;
abspos += root->position();
}
assert(root->m_desktop);
abspos += root->position();
}
assert(root->m_desktop);
@@
-205,12
+207,11
@@
eWidget::~eWidget()
m_parent = 0;
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())
{
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);
}
}
i = m_childs.erase(i);
}
}
@@
-275,6
+276,11
@@
void eWidget::recalcClipRegionsWhenVisible()
} while(1);
}
} while(1);
}
+void eWidget::parentRemoved()
+{
+ m_parent = 0;
+}
+
int eWidget::event(int event, void *data, void *data2)
{
switch (event)
int eWidget::event(int event, void *data, void *data2)
{
switch (event)