widget: don't crash when deallocating in wrong order
[enigma2.git] / lib / gui / ewidget.cpp
index 6f7fa91b30c40b3a895d6a94c0ae7634383c5158..3bc6e663841e940e1d7506f7baf4722c90f01a24 100644 (file)
@@ -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);