X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=otk%2Fwidget.cc;h=9708977d47732ffa03f674eb06c25fa78cf63c1e;hb=92bc846ce16fe5fb63c2b4b38a780489e2979b11;hp=0675bf6ac290f709ad8ae3d9f107c6fa1871699b;hpb=38345bf32eeb1d506ce1f3fde93145a2c55828f3;p=chaz%2Fopenbox diff --git a/otk/widget.cc b/otk/widget.cc index 0675bf6a..9708977d 100644 --- a/otk/widget.cc +++ b/otk/widget.cc @@ -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)