]> Dogcows Code - chaz/openbox/blobdiff - otk/widget.cc
add some tests
[chaz/openbox] / otk / widget.cc
index 0675bf6ac290f709ad8ae3d9f107c6fa1871699b..9708977d47732ffa03f674eb06c25fa78cf63c1e 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)
This page took 0.021776 seconds and 4 git commands to generate.