XSetWindowBackgroundPixmap(**display, _window, _surface->pixmap());
- delete s; // delete the old surface *after* its pixmap isn't in use anymore
+ if (s)
+ delete s; // delete the old surface *after* its pixmap isn't in use anymore
}
void Widget::adjust(void)
void Widget::update()
{
+ WidgetList::iterator it = _children.begin(), end = _children.end();
+ for (; it != end; ++it)
+ (*it)->update();
+
if (_dirty) {
adjust();
render();
XClearWindow(**display, _window);
}
- WidgetList::iterator it = _children.begin(), end = _children.end();
- for (; it != end; ++it)
- (*it)->update();
-
_dirty = false;
}