#include "wx/listbox.h"
#include "wx/scrolwin.h"
#include "wx/layout.h"
+ #include "wx/menuitem.h"
+ #include "wx/module.h"
#endif
-#include "wx/module.h"
-#include "wx/menuitem.h"
#include "wx/fontutil.h"
#include "wx/univ/renderer.h"
}
// Destroy the window
- Window xwindow = (Window) m_mainWindow;
- wxDeleteWindowFromTable( xwindow );
- XDestroyWindow( wxGlobalDisplay(), xwindow );
- m_mainWindow = NULL;
+ if ( m_mainWindow )
+ {
+ Window xwindow = (Window) m_mainWindow;
+ wxDeleteWindowFromTable( xwindow );
+ XDestroyWindow( wxGlobalDisplay(), xwindow );
+ m_mainWindow = NULL;
+ }
}
// ---------------------------------------------------------------------------
class wxWinModule : public wxModule
{
public:
- bool OnInit();
- void OnExit();
+ wxWinModule()
+ {
+ // we must be cleaned up before the display is closed
+ AddDependency(wxClassInfo::FindClass(_T("wxX11DisplayModule")));
+ }
+
+ virtual bool OnInit();
+ virtual void OnExit();
private:
DECLARE_DYNAMIC_CLASS(wxWinModule)