diff --git a/src/common/QskMetaFunction.cpp b/src/common/QskMetaFunction.cpp index 56d04080..9b3bea0d 100644 --- a/src/common/QskMetaFunction.cpp +++ b/src/common/QskMetaFunction.cpp @@ -204,14 +204,18 @@ void QskMetaFunction::invoke( QObject* object, return; } +#if QT_CONFIG(thread) QSemaphore semaphore; +#endif auto event = new QMetaCallEvent( m_functionCall, nullptr, 0, argv, &semaphore ); QCoreApplication::postEvent( receiver, event ); +#if QT_CONFIG(thread) semaphore.acquire(); +#endif break; } diff --git a/src/common/QskMetaInvokable.cpp b/src/common/QskMetaInvokable.cpp index 1f73633d..64c118f0 100644 --- a/src/common/QskMetaInvokable.cpp +++ b/src/common/QskMetaInvokable.cpp @@ -192,14 +192,18 @@ static void qskInvokeMetaCall( return; } +#if QT_CONFIG(thread) QSemaphore semaphore; +#endif auto event = new MetaCallEvent( call, metaObject, offset, index, args, &semaphore ); QCoreApplication::postEvent( receiver, event ); +#if QT_CONFIG(thread) semaphore.acquire(); +#endif break; }