diff --git a/src/drivers/win/memview.cpp b/src/drivers/win/memview.cpp
index 7cd0ef3a..0cbeba36 100644
--- a/src/drivers/win/memview.cpp
+++ b/src/drivers/win/memview.cpp
@@ -1361,6 +1361,10 @@ LRESULT CALLBACK MemViewCallB(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
}
// ################################## End of SP CODE ###########################
+ case ID_MEMWVIEW_FILE_CLOSE:
+ KillMemView();
+ return 0;
+
case MENU_MV_EDIT_UNDO:
UndoLastPatch();
return 0;
diff --git a/src/drivers/win/memview.h b/src/drivers/win/memview.h
index d14ad92e..a6e7360b 100644
--- a/src/drivers/win/memview.h
+++ b/src/drivers/win/memview.h
@@ -1,4 +1,5 @@
void DoMemView();
+void KillMemView();
void UpdateMemoryView(int draw_all);
void UpdateColorTable();
void ChangeMemViewFocus(int newEditingMode, int StartOffset,int EndOffset);
diff --git a/src/drivers/win/res.rc b/src/drivers/win/res.rc
index 8b9e2264..f203cbc4 100644
--- a/src/drivers/win/res.rc
+++ b/src/drivers/win/res.rc
@@ -204,6 +204,8 @@ BEGIN
MENUITEM "&Ram", MENU_MV_FILE_DUMP_RAM
MENUITEM "&PPU Memory", MENU_MV_FILE_DUMP_PPU
END
+ MENUITEM SEPARATOR
+ MENUITEM "Close", ID_MEMWVIEW_FILE_CLOSE
END
POPUP "&Edit"
BEGIN
diff --git a/src/drivers/win/resource.h b/src/drivers/win/resource.h
index ea1a5481..13cacfcf 100644
--- a/src/drivers/win/resource.h
+++ b/src/drivers/win/resource.h
@@ -607,6 +607,8 @@
#define ID_EDIT_BRANCH 40212
#define ID_EDIT_SELECTALL 40214
#define ID_EDIT_REMOVEMARKER 40215
+#define ID_FILE_CLOSECTRL40216 40216
+#define ID_MEMWVIEW_FILE_CLOSE 40217
#define MW_ValueLabel2 65423
#define MW_ValueLabel1 65426
#define GUI_BOT_DEBUG 65436
@@ -617,7 +619,7 @@
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 121
-#define _APS_NEXT_COMMAND_VALUE 40216
+#define _APS_NEXT_COMMAND_VALUE 40218
#define _APS_NEXT_CONTROL_VALUE 1150
#define _APS_NEXT_SYMED_VALUE 101
#endif
diff --git a/src/drivers/win/window.cpp b/src/drivers/win/window.cpp
index 7e3d9ce8..40237b63 100644
--- a/src/drivers/win/window.cpp
+++ b/src/drivers/win/window.cpp
@@ -239,7 +239,8 @@ void updateGameDependentMenus(unsigned int enable)
MENU_TRACELOGGER,
MENU_CDLOGGER,
MENU_GAMEGENIEDECODER,
- MENU_CHEATS
+ MENU_CHEATS,
+ ID_TOOLS_TEXTHOOKER
};
for (unsigned int i = 0; i < sizeof(menu_ids) / sizeof(*menu_ids); i++)
@@ -1090,7 +1091,8 @@ LRESULT FAR PASCAL AppWndProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam)
// User selected the Close File menu => Close the game if necessary
if(GameInfo)
{
- FCEUI_CloseGame();
+ FCEUI_CloseGame();
+ KillMemView();
updateGameDependentMenus(GameInfo != 0);
}
break;
diff --git a/vc8/fceux.vcproj b/vc8/fceux.vcproj
index 63be8bac..a6acd21c 100644
--- a/vc8/fceux.vcproj
+++ b/vc8/fceux.vcproj
@@ -1183,6 +1183,14 @@
RelativePath="..\src\drivers\win\tasedit.h"
>
+
+
+
+