Fix a bug that KillMemView() calls multiple times to cause crash problems.

This commit is contained in:
owomomo 2020-10-05 19:12:47 +08:00
parent d4a8962695
commit d5ff6ff2fe
2 changed files with 12 additions and 15 deletions

View File

@ -1179,15 +1179,17 @@ void AutoScrollFromCoord(int x,int y)
}
void KillMemView()
{
if (hMemView)
{
ReleaseDC(hMemView, mDC);
DestroyWindow(hMemView);
UnregisterClass("MEMVIEW", fceu_hInstance);
hMemView = 0;
hMemFind = 0;
hMemView = NULL;
hMemFind = NULL;
if (EditingMode == MODE_NES_MEMORY)
ReleaseCheatMap();
return;
}
}
int GetMaxSize(int EditingMode)
@ -2485,10 +2487,6 @@ LRESULT CALLBACK MemViewCallB(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
case WM_CLOSE:
KillMemView();
//ReleaseDC (hwnd, mDC) ;
//DestroyWindow(hMemView);
//UnregisterClass("MEMVIEW",fceu_hInstance);
//hMemView = 0;
return 0;
}
return DefWindowProc (hwnd, message, wParam, lParam) ;

View File

@ -372,7 +372,6 @@ void updateBookmarkMenus(HMENU menu)
ModifyMenu(menu, ID_FIRST_BOOKMARK + hexBookmarks.shortcuts[i], MF_BYCOMMAND, ID_FIRST_BOOKMARK + hexBookmarks.shortcuts[i], buffer);
}
}
}
}