Set the application context while creating a LinphoneCore with LinphoneFactory.createLinphoneCore(listener, context)

This commit is contained in:
François Grisez 2014-11-07 17:11:26 +01:00
parent 7787c91c46
commit 512093a3ee
2 changed files with 4 additions and 1 deletions

View file

@ -98,7 +98,9 @@ public class LinphoneCoreFactoryImpl extends LinphoneCoreFactory {
public LinphoneCore createLinphoneCore(LinphoneCoreListener listener, Object context) throws LinphoneCoreException {
try {
MediastreamerAndroidContext.setContext(context);
return new LinphoneCoreImpl(listener);
LinphoneCore lc = new LinphoneCoreImpl(listener);
if(context!=null) lc.setContext(context);
return lc;
} catch (IOException e) {
throw new LinphoneCoreException("Cannot create LinphoneCore",e);
}

View file

@ -268,6 +268,7 @@ class LinphoneCoreImpl implements LinphoneCore {
return logs;
}
public synchronized void destroy() {
setAndroidPowerManager(null);
delete(nativePtr);
nativePtr=0;
}