diff --git a/xvaga/oswin32.cpp b/xvaga/oswin32.cpp index 0d8a477db..58a1e3565 100755 --- a/xvaga/oswin32.cpp +++ b/xvaga/oswin32.cpp @@ -624,8 +624,11 @@ unsigned int OsWin32_FindMenuContainer() static BOOL CALLBACK CountChildrenProc(HWND hwnd, LPARAM lParam) { - LONG* n = (LONG*)lParam; - (*n)++; + if (lParam) + { + LONG* n = (LONG*)lParam; + (*n)++; + } return TRUE; } @@ -661,7 +664,10 @@ static BOOL CALLBACK CloseSiblingProc(HWND hwnd, LPARAM lParam) { ::GetWindowText(hwnd, str, sizeof(str)); if (str[0] == '\0') - ::PostMessage(hwnd, WM_ENDSESSION, 0, 0); + { + OsWin32_CloseChildren((UINT)hwnd); + CloseChildrenProc(hwnd, 0L); + } } } } @@ -670,7 +676,8 @@ static BOOL CALLBACK CloseSiblingProc(HWND hwnd, LPARAM lParam) void OsWin32_CloseSiblings(unsigned int parent) { - ::EnumWindows(CloseSiblingProc, parent); + // NON FUNZIONA!!!!!!!!!!!!!!!!!!!!!!!!!!! + // ::EnumWindows(CloseSiblingProc, parent); } /////////////////////////////////////////////////////////// diff --git a/xvaga/xvtwin.cpp b/xvaga/xvtwin.cpp index 57750e91d..fe39e6f2d 100755 --- a/xvaga/xvtwin.cpp +++ b/xvaga/xvtwin.cpp @@ -1153,6 +1153,7 @@ TTaskWin::~TTaskWin() xvt_res_free_menu_tree(m_menu); m_menu = NULL; } + wxExit(); // Exits main loop in the "rare" case it's still running } ///////////////////////////////////////////////////////////