Skip to content

Commit 35ae230

Browse files
committed
xrECore/ELog: async invoke in ELogCallback
1 parent e52b701 commit 35ae230

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/editors/xrECore/Core/ELog.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,22 @@ XRECORE_API void ELogCallback(void* context, pcstr message)
5656

5757
if (windowLog)
5858
{
59+
5960
if (isDialog)
6061
{
6162
auto d = gcnew WindowLog::AddMessageDelegate(windowLog, &WindowLog::AddDialogMessage);
62-
windowLog->Invoke(d, gcnew array<Object^> { (int)type, gcnew String(message) });
63+
if (windowLog->InvokeRequired)
64+
windowLog->BeginInvoke(d, gcnew array<Object^> { (int)type, gcnew String(message) });
65+
else
66+
d(type, gcnew String(message));;
6367
}
6468
else
6569
{
6670
auto d = gcnew WindowLog::AddMessageDelegate(windowLog, &WindowLog::AddMessage);
67-
windowLog->Invoke(d, gcnew array<Object^> { (int)type, gcnew String(message) });
71+
if (windowLog->InvokeRequired)
72+
windowLog->BeginInvoke(d, gcnew array<Object^> { (int)type, gcnew String(message) });
73+
else
74+
d(type, gcnew String(message));
6875
}
6976
}
7077
}

0 commit comments

Comments
 (0)