mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-17 02:45: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/audio/audiodeviceinfolist.h"
|
||||||
#include "blackmisc/threadutils.h"
|
#include "blackmisc/threadutils.h"
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
#include "comdef.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
using namespace BlackCore::Context;
|
using namespace BlackCore::Context;
|
||||||
@@ -55,11 +59,9 @@ namespace BlackCore
|
|||||||
connect(m_connection, &CClientConnection::audioReceived, this, &CAfvClient::audioOutDataAvailable);
|
connect(m_connection, &CClientConnection::audioReceived, this, &CAfvClient::audioOutDataAvailable);
|
||||||
connect(m_voiceServerPositionTimer, &QTimer::timeout, this, &CAfvClient::onPositionUpdateTimer);
|
connect(m_voiceServerPositionTimer, &QTimer::timeout, this, &CAfvClient::onPositionUpdateTimer);
|
||||||
|
|
||||||
// deferred init
|
// deferred init - use BlackMisc:: singleShot to call in correct thread, "myself" NOT needed
|
||||||
QPointer<CAfvClient> myself(this);
|
BlackMisc::singleShot(1000, this, [ = ]
|
||||||
QTimer::singleShot(1000, this, [ = ]
|
|
||||||
{
|
{
|
||||||
if (!myself) { return; }
|
|
||||||
this->deferredInit();
|
this->deferredInit();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user