TONY: Fix a crash from objects being destroyed in the wrong order

This commit is contained in:
Paul Gilbert 2012-05-05 20:29:37 +10:00
parent fbee927c6a
commit aa603d5a67
4 changed files with 13 additions and 6 deletions

View File

@ -410,7 +410,6 @@ void TonyEngine::Close(void) {
CloseMusic();
CloseHandle(m_hEndOfFrame);
_theBoxes.Close();
RMText::Unload();
_theEngine.Close();
m_wnd.Close();
delete[] m_curThumbnail;

View File

@ -108,7 +108,6 @@ public:
FPSTREAM *m_stream[6];
FPSFX *m_sfx[MAX_SFX_CHANNELS];
FPSFX *m_utilSfx[MAX_SFX_CHANNELS];
RMGfxEngine theEngine;
RMFont *fonts[2];
bool m_bPaused;
bool m_bDrawLocation;
@ -117,8 +116,8 @@ public:
// Bounding box list manager
RMGameBoxes _theBoxes;
RMGfxEngine _theEngine;
RMWindow m_wnd;
RMGfxEngine _theEngine;
bool m_bQuitNow;
bool m_bTimeFreezed;

View File

@ -57,9 +57,18 @@ namespace Tony {
static uint16 m_wPrecalcTable[0x10000];
/****************************************************************************\
* Metodi di RMWindow
* RMWindow Methods
\****************************************************************************/
RMWindow::RMWindow() {
m_Primary = NULL; m_Back = NULL;
}
RMWindow::~RMWindow() {
Close();
RMText::Unload();
}
#ifdef REFACTOR_ME
LRESULT CALLBACK GlobalWindowProc(HWND hWnd, uint32 msg, uint16 wParam, int32 lParam) {
if ((HWND)theGame.m_wnd == NULL)

View File

@ -121,8 +121,8 @@ protected:
void WipeEffect(Common::Rect &rcBoundEllipse);
public:
RMWindow() { m_Primary = NULL; m_Back = NULL; };
~RMWindow() { Close(); }
RMWindow();
~RMWindow();
// Inizializzazione
void Init(/*HINSTANCE hInst*/);