diff options
author | George Hazan <ghazan@miranda.im> | 2018-06-19 14:06:30 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-06-19 14:06:30 +0300 |
commit | 98166ec48d49755c8915d0cc7fa87fdf3084a15c (patch) | |
tree | 9e936432c62bb2f3c62915754ca5cad794855ab6 | |
parent | 42425542f1ff6c5e2ece094e004b628e8ed4514d (diff) |
we shall not clear events that we don't own
-rw-r--r-- | plugins/Db3x_mmap/src/database.cpp | 3 | ||||
-rw-r--r-- | src/mir_app/src/database.cpp | 5 | ||||
-rw-r--r-- | src/mir_app/src/miranda.cpp | 9 | ||||
-rw-r--r-- | src/mir_app/src/modules.cpp | 1 |
4 files changed, 6 insertions, 12 deletions
diff --git a/plugins/Db3x_mmap/src/database.cpp b/plugins/Db3x_mmap/src/database.cpp index bd7a60a893..1f898d9945 100644 --- a/plugins/Db3x_mmap/src/database.cpp +++ b/plugins/Db3x_mmap/src/database.cpp @@ -23,9 +23,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "stdafx.h"
-int InitIni(void);
-void UninitIni(void);
-
DWORD CDb3Mmap::CreateNewSpace(int bytes)
{
DWORD ofsNew = m_dbHeader.ofsFileEnd;
diff --git a/src/mir_app/src/database.cpp b/src/mir_app/src/database.cpp index 5722575c29..4c41fa8f4b 100644 --- a/src/mir_app/src/database.cpp +++ b/src/mir_app/src/database.cpp @@ -510,10 +510,5 @@ int LoadDatabaseModule(void) }
while (retry);
- if (rc == ERROR_SUCCESS) {
- InitIni();
- return 0;
- }
-
return rc;
}
diff --git a/src/mir_app/src/miranda.cpp b/src/mir_app/src/miranda.cpp index 691d6847a3..60e9553540 100644 --- a/src/mir_app/src/miranda.cpp +++ b/src/mir_app/src/miranda.cpp @@ -95,9 +95,9 @@ struct MWaitableObject ::CloseHandle(m_hEvent);
}
- bool m_bOwnsEvent;
HANDLE m_hEvent;
MWaitableStub m_pFunc;
+ bool m_bOwnsEvent;
};
static OBJLIST<MWaitableObject> arWaitableObjects(1, HandleKeySortT);
@@ -343,9 +343,10 @@ int WINAPI mir_main(LPTSTR cmdLine) BOOL dying = FALSE;
DWORD rc = myWait();
if (rc < WAIT_OBJECT_0 + arWaitableObjects.getCount()) {
- rc -= WAIT_OBJECT_0;
- (*arWaitableObjects[rc].m_pFunc)();
- arWaitableObjects.remove(rc);
+ auto &pWait = arWaitableObjects[rc - WAIT_OBJECT_0];
+ (*pWait.m_pFunc)();
+ if (pWait.m_bOwnsEvent)
+ arWaitableObjects.remove(&pWait);
}
while (PeekMessage(&msg, nullptr, 0, 0, PM_REMOVE)) {
diff --git a/src/mir_app/src/modules.cpp b/src/mir_app/src/modules.cpp index 20ee0ef05a..7d7f116676 100644 --- a/src/mir_app/src/modules.cpp +++ b/src/mir_app/src/modules.cpp @@ -128,6 +128,7 @@ int LoadDefaultModules(void) plugin_service = nullptr;
}
+ InitIni();
if (LoadSkinSounds()) return 1;
if (LoadSkinHotkeys()) return 1;
if (LoadFontserviceModule()) return 1;
|