mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 12:08:54 +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
|
@ -1478,6 +1478,7 @@ void Application::updateHeartbeat() const {
|
||||||
|
|
||||||
void Application::aboutToQuit() {
|
void Application::aboutToQuit() {
|
||||||
emit beforeAboutToQuit();
|
emit beforeAboutToQuit();
|
||||||
|
DependencyManager::get<AudioClient>()->beforeAboutToQuit();
|
||||||
|
|
||||||
foreach(auto inputPlugin, PluginManager::getInstance()->getInputPlugins()) {
|
foreach(auto inputPlugin, PluginManager::getInstance()->getInputPlugins()) {
|
||||||
if (inputPlugin->isActive()) {
|
if (inputPlugin->isActive()) {
|
||||||
|
@ -1579,6 +1580,8 @@ void Application::cleanupBeforeQuit() {
|
||||||
}
|
}
|
||||||
|
|
||||||
Application::~Application() {
|
Application::~Application() {
|
||||||
|
DependencyManager::destroy<Preferences>();
|
||||||
|
|
||||||
_entityClipboard->eraseAllOctreeElements();
|
_entityClipboard->eraseAllOctreeElements();
|
||||||
_entityClipboard.reset();
|
_entityClipboard.reset();
|
||||||
|
|
||||||
|
|
|
@ -82,10 +82,10 @@ public:
|
||||||
|
|
||||||
CheckDevicesThread(AudioClient* audioClient)
|
CheckDevicesThread(AudioClient* audioClient)
|
||||||
: _audioClient(audioClient) {
|
: _audioClient(audioClient) {
|
||||||
|
}
|
||||||
|
|
||||||
connect(qApp, &QCoreApplication::aboutToQuit, [this] {
|
void beforeAboutToQuit() {
|
||||||
_quit = true;
|
_quit = true;
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void run() override {
|
void run() override {
|
||||||
|
@ -159,10 +159,10 @@ AudioClient::AudioClient() :
|
||||||
_outputDevices = getDeviceNames(QAudio::AudioOutput);
|
_outputDevices = getDeviceNames(QAudio::AudioOutput);
|
||||||
|
|
||||||
// start a thread to detect any device changes
|
// start a thread to detect any device changes
|
||||||
QThread* checkDevicesThread = new CheckDevicesThread(this);
|
_checkDevicesThread = new CheckDevicesThread(this);
|
||||||
checkDevicesThread->setObjectName("CheckDevices Thread");
|
_checkDevicesThread->setObjectName("CheckDevices Thread");
|
||||||
checkDevicesThread->setPriority(QThread::LowPriority);
|
_checkDevicesThread->setPriority(QThread::LowPriority);
|
||||||
checkDevicesThread->start();
|
_checkDevicesThread->start();
|
||||||
|
|
||||||
configureReverb();
|
configureReverb();
|
||||||
|
|
||||||
|
@ -177,6 +177,7 @@ AudioClient::AudioClient() :
|
||||||
}
|
}
|
||||||
|
|
||||||
AudioClient::~AudioClient() {
|
AudioClient::~AudioClient() {
|
||||||
|
delete _checkDevicesThread;
|
||||||
stop();
|
stop();
|
||||||
if (_codec && _encoder) {
|
if (_codec && _encoder) {
|
||||||
_codec->releaseEncoder(_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) {
|
void AudioClient::handleMismatchAudioFormat(SharedNodePointer node, const QString& currentCodec, const QString& recievedCodec) {
|
||||||
qCDebug(audioclient) << __FUNCTION__ << "sendingNode:" << *node << "currentCodec:" << currentCodec << "recievedCodec:" << recievedCodec;
|
qCDebug(audioclient) << __FUNCTION__ << "sendingNode:" << *node << "currentCodec:" << currentCodec << "recievedCodec:" << recievedCodec;
|
||||||
selectAudioFormat(recievedCodec);
|
selectAudioFormat(recievedCodec);
|
||||||
|
|
|
@ -155,6 +155,8 @@ public slots:
|
||||||
void audioMixerKilled();
|
void audioMixerKilled();
|
||||||
void toggleMute();
|
void toggleMute();
|
||||||
|
|
||||||
|
void beforeAboutToQuit();
|
||||||
|
|
||||||
virtual void setIsStereoInput(bool stereo) override;
|
virtual void setIsStereoInput(bool stereo) override;
|
||||||
|
|
||||||
void toggleAudioNoiseReduction() { _isNoiseGateEnabled = !_isNoiseGateEnabled; }
|
void toggleAudioNoiseReduction() { _isNoiseGateEnabled = !_isNoiseGateEnabled; }
|
||||||
|
@ -332,6 +334,8 @@ private:
|
||||||
CodecPluginPointer _codec;
|
CodecPluginPointer _codec;
|
||||||
QString _selectedCodecName;
|
QString _selectedCodecName;
|
||||||
Encoder* _encoder { nullptr }; // for outbound mic stream
|
Encoder* _encoder { nullptr }; // for outbound mic stream
|
||||||
|
|
||||||
|
QThread* _checkDevicesThread { nullptr };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,7 @@ void RunningMarker::startRunningMarker() {
|
||||||
|
|
||||||
RunningMarker::~RunningMarker() {
|
RunningMarker::~RunningMarker() {
|
||||||
deleteRunningMarkerFile();
|
deleteRunningMarkerFile();
|
||||||
_runningMarkerTimer->stop();
|
QMetaObject::invokeMethod(_runningMarkerTimer, "stop", Qt::BlockingQueuedConnection);
|
||||||
_runningMarkerThread->quit();
|
_runningMarkerThread->quit();
|
||||||
_runningMarkerTimer->deleteLater();
|
_runningMarkerTimer->deleteLater();
|
||||||
_runningMarkerThread->deleteLater();
|
_runningMarkerThread->deleteLater();
|
||||||
|
|
Loading…
Reference in a new issue