summaryrefslogtreecommitdiff
path: root/src/mir_core
diff options
context:
space:
mode:
Diffstat (limited to 'src/mir_core')
-rw-r--r--src/mir_core/modules.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mir_core/modules.cpp b/src/mir_core/modules.cpp
index 6899a2dbf3..ae122eb0f3 100644
--- a/src/mir_core/modules.cpp
+++ b/src/mir_core/modules.cpp
@@ -563,7 +563,10 @@ MIR_CORE_DLL(INT_PTR) CallServiceSync(const char *name, WPARAM wParam, LPARAM lP
MIR_CORE_DLL(int) CallFunctionAsync(void (__stdcall *func)(void *), void *arg)
{
- QueueMainThread((PAPCFUNC)func, arg, 0);
+ if (GetCurrentThreadId() == mainThreadId)
+ func(arg);
+ else
+ QueueMainThread((PAPCFUNC)func, arg, 0);
return 0;
}