mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 12:55:33 +08:00
[AFV] Ref T730, use BlackMisc::singleShot to call deferredInit() in correct thread
This commit is contained in:
@@ -13,6 +13,10 @@
|
||||
#include "blackmisc/audio/audiodeviceinfolist.h"
|
||||
#include "blackmisc/threadutils.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#include "comdef.h"
|
||||
#endif
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
using namespace BlackCore::Context;
|
||||
@@ -55,11 +59,9 @@ namespace BlackCore
|
||||
connect(m_connection, &CClientConnection::audioReceived, this, &CAfvClient::audioOutDataAvailable);
|
||||
connect(m_voiceServerPositionTimer, &QTimer::timeout, this, &CAfvClient::onPositionUpdateTimer);
|
||||
|
||||
// deferred init
|
||||
QPointer<CAfvClient> myself(this);
|
||||
QTimer::singleShot(1000, this, [ = ]
|
||||
// deferred init - use BlackMisc:: singleShot to call in correct thread, "myself" NOT needed
|
||||
BlackMisc::singleShot(1000, this, [ = ]
|
||||
{
|
||||
if (!myself) { return; }
|
||||
this->deferredInit();
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user