summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--win/Leocad.cpp8
-rw-r--r--win/Mainfrm.cpp4
-rw-r--r--win/Mainfrm.h1
3 files changed, 7 insertions, 6 deletions
diff --git a/win/Leocad.cpp b/win/Leocad.cpp
index c125ab3..701e4f1 100644
--- a/win/Leocad.cpp
+++ b/win/Leocad.cpp
@@ -258,15 +258,19 @@ int CCADApp::ExitInstance()
{
project->HandleNotify(LC_ACTIVATE, 0);
delete project;
+ project = NULL;
}
+ delete main_window;
+ main_window = NULL;
+
+ GL_Shutdown ();
+
#ifdef _DEBUG
if (__hStdOut != NULL)
FreeConsole();
#endif
- GL_Shutdown ();
-
return CWinApp::ExitInstance();
}
diff --git a/win/Mainfrm.cpp b/win/Mainfrm.cpp
index 74254ef..237a670 100644
--- a/win/Mainfrm.cpp
+++ b/win/Mainfrm.cpp
@@ -93,12 +93,10 @@ CMainFrame::CMainFrame()
{
m_pwndFullScrnBar = NULL;
m_bAutoMenuEnable = FALSE;
- m_pMainWnd = new MainWnd ();
}
CMainFrame::~CMainFrame()
{
- delete m_pMainWnd;
}
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
@@ -205,7 +203,7 @@ int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
messenger->Listen (&mainframe_listener, this);
- m_pMainWnd->SetXID (this);
+ main_window->SetXID (this);
return 0;
}
diff --git a/win/Mainfrm.h b/win/Mainfrm.h
index 06bf001..8b54ab5 100644
--- a/win/Mainfrm.h
+++ b/win/Mainfrm.h
@@ -22,7 +22,6 @@ class CMainFrame : public CFrameWnd
protected: // create from serialization only
CMainFrame();
DECLARE_DYNCREATE(CMainFrame)
- MainWnd* m_pMainWnd;
// Attributes
public: