diff --git a/desmume/src/windows/ram_search.cpp b/desmume/src/windows/ram_search.cpp index 4187c575a..bb32a9cda 100644 --- a/desmume/src/windows/ram_search.cpp +++ b/desmume/src/windows/ram_search.cpp @@ -46,7 +46,7 @@ #include "stdint.h" #endif -HWND RamSearchHWnd; +HWND RamSearchHWnd = NULL; extern HWND RamWatchHWnd; @@ -1175,7 +1175,7 @@ LRESULT CustomDraw (LPARAM lParam) //extern "C" int disableRamSearchUpdate; void Update_RAM_Search() //keeps RAM values up to date in the search and watch windows { - + if (!RamSearchHWnd) return; // if(disableRamSearchUpdate) // return; diff --git a/desmume/src/windows/ramwatch.cpp b/desmume/src/windows/ramwatch.cpp index b2b2676c9..7a8cbd4ba 100644 --- a/desmume/src/windows/ramwatch.cpp +++ b/desmume/src/windows/ramwatch.cpp @@ -12,7 +12,7 @@ #include #include -HWND RamWatchHWnd; +HWND RamWatchHWnd = NULL; #define MESSAGEBOXPARENT (RamWatchHWnd ? RamWatchHWnd : MainWindow->getHWnd()) @@ -170,6 +170,8 @@ bool InsertWatch(const AddressWatcher& Watch, HWND parent) void Update_RAM_Watch() { + if (!RamWatchHWnd) return; + // update cached values and detect changes to displayed listview items BOOL watchChanged[MAX_WATCH_COUNT] = {0}; for(int i = 0; i < WatchCount; i++)