make the crash handler work again

This commit is contained in:
Glenn Maynard
2002-12-03 00:13:15 +00:00
parent 710c1de072
commit 236c168826
+10 -8
View File
@@ -35,9 +35,6 @@
HINSTANCE GotoURL(const char *url);
static void DoSave(const EXCEPTION_POINTERS *pExc);
/* in StepMania.cpp */
void CleanupForRestart();
///////////////////////////////////////////////////////////////////////////
#define CODE_WINDOW (256)
@@ -374,7 +371,16 @@ long __stdcall CrashHandler(EXCEPTION_POINTERS *pExc) {
* the crash dialog. */
ShowWindow( g_hWndMain, SW_HIDE );
int ret = DialogBoxParam(g_hInstance, MAKEINTRESOURCE(IDD_DISASM_CRASH), NULL, CrashDlgProc, (LPARAM)pExc);
/* Little trick to get an HINSTANCE of ourself without having access to the hwnd ... */
int ret;
{
TCHAR szFullAppPath[MAX_PATH];
GetModuleFileName(NULL, szFullAppPath, MAX_PATH);
HINSTANCE handle = LoadLibrary(szFullAppPath);
ret = DialogBoxParam(handle, MAKEINTRESOURCE(IDD_DISASM_CRASH), g_hWndMain, CrashDlgProc, (LPARAM)pExc);
}
/* Returns TRUE if we want to pop up the standard crash box;
* FALSE if we should just die. */
VDDebugInfoDeinit(&g_debugInfo);
@@ -1455,10 +1461,6 @@ BOOL APIENTRY CrashDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) {
return TRUE;
case IDC_BUTTON_RESTART:
{
/* Clear the startup mutex, since we're starting a new
* instance before ending ourself. */
CleanupForRestart();
char cwd[MAX_PATH];
SpliceProgramPath(cwd, MAX_PATH, "");