From 91cccbcb4d7cade5702b59b36c0c66a02dea73d7 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 16 Mar 2014 20:31:39 +0000 Subject: minor optimization git-svn-id: http://svn.miranda-ng.org/main/trunk@8642 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/mir_core/modules.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/mir_core') 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; } -- cgit v1.2.3