1
0
mirror of https://gitee.com/drabel/LibQQt.git synced 2025-01-04 10:18:44 +08:00

fix audio manager sigsegv

This commit is contained in:
tianduanrui 2018-02-10 18:19:14 +08:00
parent 723e3b7000
commit 5ff3e0ad41
3 changed files with 26 additions and 6 deletions

View File

@ -19,8 +19,7 @@ SUBDIRS = src/qqt.pro
##QQt installed to sdk or
##QQt is build
##-----------------------------------------------------------------
#
SUBDIRS += examples/exquisite
#SUBDIRS += examples/exquisite
#SUBDIRS += examples/tabwidgetexamples
#SUBDIRS += examples/qrcodeexample
#SUBDIRS += examples/qqtnetworkexample

View File

@ -50,13 +50,15 @@ void QQtAudioManager::stopInput()
//输入设备还开着那么输入流设备一定开着。这是QQtAudioManager的功能设定。
if ( mInputDevice )
{
disconnect ( mInputDevice, SIGNAL ( readyRead() ), this, SIGNAL ( readyRead() ) );
mInputDevice = NULL;
//关闭QAudioInput等于关闭了拾音器。
//这两个函数有一个应该是deleteLater迅速执行了会释放mInputDevice导致野指针在android设备上会崩溃。此处注意。把disconnect函数提前。
//注释mInputDevice是mInputManager的读写口由mInputManager内部产生和释放。
mInputManager->stop();
mInputManager->deleteLater();
mInputManager = NULL;
disconnect ( mInputDevice, SIGNAL ( readyRead() ), this, SIGNAL ( readyRead() ) );
mInputDevice = NULL;
}
}
@ -81,11 +83,12 @@ void QQtAudioManager::stopOutput()
{
if ( mOutputDevice )
{
mOutputDevice = NULL;
mOutputManager->stop();
mOutputManager->deleteLater();
mOutputManager = NULL;
mOutputDevice = NULL;
}
}

View File

@ -77,4 +77,22 @@
<!-- %%INSERT_PERMISSIONS -->
<!-- %%INSERT_FEATURES -->
<uses-permission android:name="android.permission.CALL_PHONE"/>
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_SOCIAL_STREAM"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.CALL_PRIVILEGED"/>
<uses-permission android:name="android.permission.FORCE_BACK"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.NFC"/>
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE"/>
<uses-permission android:name="android.permission.READ_INPUT_STATE"/>
<uses-permission android:name="android.permission.ACCESS_CHECKIN_PROPERTIES"/>
<uses-permission android:name="android.permission.DEVICE_POWER"/>
<uses-permission android:name="android.permission.SET_DEBUG_APP"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.SET_ORIENTATION"/>
</manifest>