Fix a (possible) crash in QObject::disconnect

This is https://worklist.net/19827
This commit is contained in:
Aleric Inglewood 2014-06-30 02:07:26 +02:00 committed by Carlo Wood
parent f13bbdfae6
commit 37f0635024

View file

@ -1327,8 +1327,10 @@ bool Audio::switchInputToAudioDevice(const QAudioDeviceInfo& inputDeviceInfo) {
// cleanup any previously initialized device
if (_audioInput) {
// The call to stop() causes _inputDevice to be destructed.
// That in turn causes it to be disconnected (see for example
// http://stackoverflow.com/questions/9264750/qt-signals-and-slots-object-disconnect).
_audioInput->stop();
disconnect(_inputDevice);
_inputDevice = NULL;
delete _audioInput;