2002/10/12 19:52:38
[org.ibex.core.git] / src / org / xwt / plat / POSIX.cc
index 919fc58..f34fbdf 100644 (file)
@@ -382,11 +382,16 @@ void org::xwt::plat::POSIX$X11Surface::setSize (jint width, jint height) {
     XFlush(display);
 }
 
-void org::xwt::plat::POSIX$X11Surface::_dispose() { XDestroyWindow(display, (*((Window*)window))); }
 void org::xwt::plat::POSIX$X11Surface::setLocation (jint x, jint y) { XMoveWindow(display, (*((Window*)window)), x, y); }
 void org::xwt::plat::POSIX$X11Surface::toFront() { XRaiseWindow(display, (*((Window*)window))); }
 void org::xwt::plat::POSIX$X11Surface::toBack() { XLowerWindow(display, (*((Window*)window))); }
 
+void org::xwt::plat::POSIX$X11Surface::_dispose() {
+    // without this we get phantom messages after the window is gone
+    org::xwt::plat::POSIX::windowToSurfaceMap->remove(new java::lang::Long(*((Window*)window)));
+    XDestroyWindow(display, (*((Window*)window)));
+}
+
 void org::xwt::plat::POSIX$X11Surface::setInvisible(jboolean i) {
     if (i) XUnmapWindow(display, (*((Window*)window)));
     else XMapRaised(display, (*((Window*)window)));