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:
parent
723e3b7000
commit
5ff3e0ad41
3
QQt.pro
3
QQt.pro
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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>
|
||||
|
Loading…
x
Reference in New Issue
Block a user