]> Dogcows Code - chaz/openbox/blobdiff - otk/widget.cc
not needed, the .in is commited
[chaz/openbox] / otk / widget.cc
index 0675bf6ac290f709ad8ae3d9f107c6fa1871699b..c09ac4862566e8c8f93d0f4634ff6e7e33a15065 100644 (file)
@@ -59,6 +59,9 @@ Widget::~Widget()
   if (_visible)
     hide();
 
+  if (_surface)
+    delete _surface;
+  
   _event_dispatcher->clearHandler(_window);
 
   std::for_each(_children.begin(), _children.end(), PointerAssassin());
@@ -274,7 +277,8 @@ void Widget::render(void)
 
   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)
@@ -400,16 +404,16 @@ void Widget::adjustVert(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;
 }
 
This page took 0.021266 seconds and 4 git commands to generate.