Commit a8664070 authored by Simon Morlat's avatar Simon Morlat

fix crash

parent 012bff54
...@@ -172,6 +172,7 @@ bool AudioRecordImpl::init(Library *lib){ ...@@ -172,6 +172,7 @@ bool AudioRecordImpl::init(Library *lib){
delete impl; delete impl;
return false; return false;
} }
sImpl=impl;
if (impl->mApiVersion>=19){ if (impl->mApiVersion>=19){
AudioRecord *test=new AudioRecord(); AudioRecord *test=new AudioRecord();
//dumpMemory(test->getRealThis(),AudioRecordImpl::sObjSize); //dumpMemory(test->getRealThis(),AudioRecordImpl::sObjSize);
...@@ -184,7 +185,6 @@ bool AudioRecordImpl::init(Library *lib){ ...@@ -184,7 +185,6 @@ bool AudioRecordImpl::init(Library *lib){
} }
sp<AudioRecord> st(test); sp<AudioRecord> st(test);
} }
sImpl=impl;
} }
return true; return true;
} }
......
...@@ -249,6 +249,7 @@ namespace fake_android{ ...@@ -249,6 +249,7 @@ namespace fake_android{
fail=true; fail=true;
} }
if (!fail){ if (!fail){
sImpl=impl;
if (impl->mSdkVersion>=19){ if (impl->mSdkVersion>=19){
impl->mUseRefCount=true; impl->mUseRefCount=true;
...@@ -264,7 +265,6 @@ namespace fake_android{ ...@@ -264,7 +265,6 @@ namespace fake_android{
} }
sp<AudioTrack> st(test); sp<AudioTrack> st(test);
} }
sImpl=impl;
return true; return true;
}else{ }else{
delete impl; delete impl;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment