fix deadlock when we crash in a different thread
This commit is contained in:
@@ -271,6 +271,11 @@ static void DoEraseEmergencyDump()
|
|||||||
#include "RageSound.h"
|
#include "RageSound.h"
|
||||||
extern HWND g_hWndMain;
|
extern HWND g_hWndMain;
|
||||||
long __stdcall CrashHandler(EXCEPTION_POINTERS *pExc) {
|
long __stdcall CrashHandler(EXCEPTION_POINTERS *pExc) {
|
||||||
|
/* If we're fullscreen, the fullscreen d3d window will obscure
|
||||||
|
* the crash dialog. Do this before we suspend threads, or it'll
|
||||||
|
* deadlock if the thread controlling this window has been stopped. */
|
||||||
|
ShowWindow( g_hWndMain, SW_HIDE );
|
||||||
|
|
||||||
/////////////////////////
|
/////////////////////////
|
||||||
//
|
//
|
||||||
// QUICKLY: SUSPEND ALL THREADS THAT AREN'T US.
|
// QUICKLY: SUSPEND ALL THREADS THAT AREN'T US.
|
||||||
@@ -367,10 +372,6 @@ long __stdcall CrashHandler(EXCEPTION_POINTERS *pExc) {
|
|||||||
* dump, save it now. */
|
* dump, save it now. */
|
||||||
DoSave(pExc);
|
DoSave(pExc);
|
||||||
|
|
||||||
/* If we're fullscreen, the fullscreen d3d window will obscure
|
|
||||||
* the crash dialog. */
|
|
||||||
ShowWindow( g_hWndMain, SW_HIDE );
|
|
||||||
|
|
||||||
/* Little trick to get an HINSTANCE of ourself without having access to the hwnd ... */
|
/* Little trick to get an HINSTANCE of ourself without having access to the hwnd ... */
|
||||||
int ret;
|
int ret;
|
||||||
{
|
{
|
||||||
@@ -378,11 +379,12 @@ long __stdcall CrashHandler(EXCEPTION_POINTERS *pExc) {
|
|||||||
GetModuleFileName(NULL, szFullAppPath, MAX_PATH);
|
GetModuleFileName(NULL, szFullAppPath, MAX_PATH);
|
||||||
HINSTANCE handle = LoadLibrary(szFullAppPath);
|
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. */
|
||||||
|
ret = DialogBoxParam(handle, MAKEINTRESOURCE(IDD_DISASM_CRASH), NULL,
|
||||||
|
CrashDlgProc, (LPARAM)pExc);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Returns TRUE if we want to pop up the standard crash box;
|
|
||||||
* FALSE if we should just die. */
|
|
||||||
VDDebugInfoDeinit(&g_debugInfo);
|
VDDebugInfoDeinit(&g_debugInfo);
|
||||||
|
|
||||||
/* Major hack:
|
/* Major hack:
|
||||||
|
|||||||
Reference in New Issue
Block a user