summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/m_system.h4
-rw-r--r--libs/win32/mir_app.libbin192436 -> 192646 bytes
-rw-r--r--libs/win64/mir_app.libbin188266 -> 188456 bytes
-rw-r--r--plugins/Clist_modern/src/modern_clistmenus.cpp6
-rw-r--r--plugins/Clist_nicer/src/clistmenus.cpp6
-rw-r--r--src/core/stdclist/src/clistmenus.cpp5
-rw-r--r--src/mir_app/src/mir_app.def1
-rw-r--r--src/mir_app/src/mir_app64.def1
-rw-r--r--src/mir_app/src/miranda.cpp14
9 files changed, 23 insertions, 14 deletions
diff --git a/include/m_system.h b/include/m_system.h
index d7185749c2..761daf613a 100644
--- a/include/m_system.h
+++ b/include/m_system.h
@@ -112,6 +112,10 @@ EXTERN_C MIR_APP_DLL(bool) Miranda_IsTerminated(void);
// if everyone acknowleges OK to exit then returns true, otherwise false
EXTERN_C MIR_APP_DLL(bool) Miranda_OkToExit(void);
+// Used by contact lists inside CloseAction
+// Waits for a permission to exit and destroys contact list
+EXTERN_C MIR_APP_DLL(void) Miranda_Close(void);
+
/*
wParam : 0
lParam : (address) void (__cdecl *callback) (void)
diff --git a/libs/win32/mir_app.lib b/libs/win32/mir_app.lib
index d99d5ae292..170f3057e1 100644
--- a/libs/win32/mir_app.lib
+++ b/libs/win32/mir_app.lib
Binary files differ
diff --git a/libs/win64/mir_app.lib b/libs/win64/mir_app.lib
index 58af358c74..949c6338e3 100644
--- a/libs/win64/mir_app.lib
+++ b/libs/win64/mir_app.lib
Binary files differ
diff --git a/plugins/Clist_modern/src/modern_clistmenus.cpp b/plugins/Clist_modern/src/modern_clistmenus.cpp
index ab705cb225..92c8d4b831 100644
--- a/plugins/Clist_modern/src/modern_clistmenus.cpp
+++ b/plugins/Clist_modern/src/modern_clistmenus.cpp
@@ -129,11 +129,7 @@ void UnloadFavoriteContactMenu()
static INT_PTR CloseAction(WPARAM, LPARAM)
{
g_CluiData.bSTATE = STATE_PREPARETOEXIT; // workaround for avatar service and other wich destroys service on OK_TOEXIT
-
- while (!Miranda_OkToExit())
- Sleep(100);
-
- DestroyWindow(g_clistApi.hwndContactList);
+ Miranda_Close();
return 0;
}
diff --git a/plugins/Clist_nicer/src/clistmenus.cpp b/plugins/Clist_nicer/src/clistmenus.cpp
index 58a075f242..620b65f555 100644
--- a/plugins/Clist_nicer/src/clistmenus.cpp
+++ b/plugins/Clist_nicer/src/clistmenus.cpp
@@ -35,11 +35,7 @@ void InitIconLibMenuIcons();
INT_PTR CloseAction(WPARAM, LPARAM)
{
cfg::shutDown = 1;
-
- while (!Miranda_OkToExit())
- Sleep(100);
-
- DestroyWindow(g_clistApi.hwndContactList);
+ Miranda_Close();
PostQuitMessage(0);
return 0;
}
diff --git a/src/core/stdclist/src/clistmenus.cpp b/src/core/stdclist/src/clistmenus.cpp
index 81f248bf59..753352cc79 100644
--- a/src/core/stdclist/src/clistmenus.cpp
+++ b/src/core/stdclist/src/clistmenus.cpp
@@ -26,10 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
static INT_PTR CloseAction(WPARAM, LPARAM)
{
- while (!Miranda_OkToExit())
- Sleep(100);
-
- DestroyWindow(g_clistApi.hwndContactList);
+ Miranda_Close();
return 0;
}
diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def
index 210f167b8f..2820883800 100644
--- a/src/mir_app/src/mir_app.def
+++ b/src/mir_app/src/mir_app.def
@@ -1,6 +1,7 @@
LIBRARY mir_app.mir
EXPORTS
+Miranda_Close @1 NONAME
CallProtoService @2
Skin_LoadProtoIcon @4
Skin_LoadIcon @5
diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def
index 132aa6225b..6ed7f2a46a 100644
--- a/src/mir_app/src/mir_app64.def
+++ b/src/mir_app/src/mir_app64.def
@@ -1,6 +1,7 @@
LIBRARY mir_app.mir
EXPORTS
+Miranda_Close @1 NONAME
CallProtoService @2
Skin_LoadProtoIcon @4
Skin_LoadIcon @5
diff --git a/src/mir_app/src/miranda.cpp b/src/mir_app/src/miranda.cpp
index 423f709d75..214a196012 100644
--- a/src/mir_app/src/miranda.cpp
+++ b/src/mir_app/src/miranda.cpp
@@ -427,6 +427,20 @@ MIR_APP_DLL(bool) Miranda_OkToExit()
return NotifyEventHooks(hOkToExitEvent, 0, 0) == 0;
}
+MIR_APP_DLL(void) Miranda_Close()
+{
+ while (!Miranda_OkToExit()) {
+ MSG msg;
+ while (PeekMessage(&msg, nullptr, 0, 0, PM_REMOVE)) {
+ TranslateMessage(&msg);
+ DispatchMessage(&msg);
+ }
+ Sleep(0);
+ }
+
+ DestroyWindow(g_clistApi.hwndContactList);
+}
+
/////////////////////////////////////////////////////////////////////////////////////////
// version functions