mirror of
https://github.com/overte-org/overte.git
synced 2025-04-22 23:13:38 +02:00
fix a couple of crash-on-exits
This commit is contained in:
parent
7a4302057a
commit
3903a51062
4 changed files with 21 additions and 8 deletions
interface/src
libraries
|
@ -1478,6 +1478,7 @@ void Application::updateHeartbeat() const {
|
|||
|
||||
void Application::aboutToQuit() {
|
||||
emit beforeAboutToQuit();
|
||||
DependencyManager::get<AudioClient>()->beforeAboutToQuit();
|
||||
|
||||
foreach(auto inputPlugin, PluginManager::getInstance()->getInputPlugins()) {
|
||||
if (inputPlugin->isActive()) {
|
||||
|
@ -1579,6 +1580,8 @@ void Application::cleanupBeforeQuit() {
|
|||
}
|
||||
|
||||
Application::~Application() {
|
||||
DependencyManager::destroy<Preferences>();
|
||||
|
||||
_entityClipboard->eraseAllOctreeElements();
|
||||
_entityClipboard.reset();
|
||||
|
||||
|
|
|
@ -82,10 +82,10 @@ public:
|
|||
|
||||
CheckDevicesThread(AudioClient* audioClient)
|
||||
: _audioClient(audioClient) {
|
||||
}
|
||||
|
||||
connect(qApp, &QCoreApplication::aboutToQuit, [this] {
|
||||
_quit = true;
|
||||
});
|
||||
void beforeAboutToQuit() {
|
||||
_quit = true;
|
||||
}
|
||||
|
||||
void run() override {
|
||||
|
@ -159,10 +159,10 @@ AudioClient::AudioClient() :
|
|||
_outputDevices = getDeviceNames(QAudio::AudioOutput);
|
||||
|
||||
// start a thread to detect any device changes
|
||||
QThread* checkDevicesThread = new CheckDevicesThread(this);
|
||||
checkDevicesThread->setObjectName("CheckDevices Thread");
|
||||
checkDevicesThread->setPriority(QThread::LowPriority);
|
||||
checkDevicesThread->start();
|
||||
_checkDevicesThread = new CheckDevicesThread(this);
|
||||
_checkDevicesThread->setObjectName("CheckDevices Thread");
|
||||
_checkDevicesThread->setPriority(QThread::LowPriority);
|
||||
_checkDevicesThread->start();
|
||||
|
||||
configureReverb();
|
||||
|
||||
|
@ -177,6 +177,7 @@ AudioClient::AudioClient() :
|
|||
}
|
||||
|
||||
AudioClient::~AudioClient() {
|
||||
delete _checkDevicesThread;
|
||||
stop();
|
||||
if (_codec && _encoder) {
|
||||
_codec->releaseEncoder(_encoder);
|
||||
|
@ -184,6 +185,11 @@ AudioClient::~AudioClient() {
|
|||
}
|
||||
}
|
||||
|
||||
void AudioClient::beforeAboutToQuit() {
|
||||
static_cast<CheckDevicesThread*>(_checkDevicesThread)->beforeAboutToQuit();
|
||||
}
|
||||
|
||||
|
||||
void AudioClient::handleMismatchAudioFormat(SharedNodePointer node, const QString& currentCodec, const QString& recievedCodec) {
|
||||
qCDebug(audioclient) << __FUNCTION__ << "sendingNode:" << *node << "currentCodec:" << currentCodec << "recievedCodec:" << recievedCodec;
|
||||
selectAudioFormat(recievedCodec);
|
||||
|
|
|
@ -155,6 +155,8 @@ public slots:
|
|||
void audioMixerKilled();
|
||||
void toggleMute();
|
||||
|
||||
void beforeAboutToQuit();
|
||||
|
||||
virtual void setIsStereoInput(bool stereo) override;
|
||||
|
||||
void toggleAudioNoiseReduction() { _isNoiseGateEnabled = !_isNoiseGateEnabled; }
|
||||
|
@ -332,6 +334,8 @@ private:
|
|||
CodecPluginPointer _codec;
|
||||
QString _selectedCodecName;
|
||||
Encoder* _encoder { nullptr }; // for outbound mic stream
|
||||
|
||||
QThread* _checkDevicesThread { nullptr };
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ void RunningMarker::startRunningMarker() {
|
|||
|
||||
RunningMarker::~RunningMarker() {
|
||||
deleteRunningMarkerFile();
|
||||
_runningMarkerTimer->stop();
|
||||
QMetaObject::invokeMethod(_runningMarkerTimer, "stop", Qt::BlockingQueuedConnection);
|
||||
_runningMarkerThread->quit();
|
||||
_runningMarkerTimer->deleteLater();
|
||||
_runningMarkerThread->deleteLater();
|
||||
|
|
Loading…
Reference in a new issue