summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mir_app/src/miranda.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/mir_app/src/miranda.cpp b/src/mir_app/src/miranda.cpp
index 089393135d..baf7bf989b 100644
--- a/src/mir_app/src/miranda.cpp
+++ b/src/mir_app/src/miranda.cpp
@@ -111,16 +111,19 @@ static void __cdecl compactHeapsThread(void*)
Thread_SetName("compactHeapsThread");
while (!Miranda_IsTerminated()) {
- HANDLE hHeaps[256];
- DWORD hc;
SleepEx((1000 * 60) * 5, TRUE); // every 5 minutes
- hc = GetProcessHeaps(255, (PHANDLE)&hHeaps);
+
+ HANDLE hHeaps[256];
+ DWORD hc = GetProcessHeaps(255, (PHANDLE)&hHeaps);
if (hc != 0 && hc < 256) {
- DWORD j;
- for (j = 0; j < hc; j++)
- HeapCompact(hHeaps[j], 0);
+ __try {
+ for (DWORD j = 0; j < hc; j++)
+ HeapCompact(hHeaps[j], 0);
+ }
+ __except (EXCEPTION_EXECUTE_HANDLER)
+ {}
}
- } //while
+ }
}
void(*SetIdleCallback) (void) = nullptr;