mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-29 00:59:20 +00:00
Do not use Java's nativePtr for Factory
This commit is contained in:
parent
2c56bf1495
commit
a2bf48f6b5
3 changed files with 5 additions and 2 deletions
|
|
@ -366,6 +366,7 @@ class JavaTranslator(object):
|
|||
methodDict['classCName'] = 'Linphone' + className.to_camel_case()
|
||||
methodDict['className'] = className.to_camel_case()
|
||||
methodDict['classImplName'] = className.to_camel_case() + 'Impl'
|
||||
methodDict['isLinphoneFactory'] = className.to_camel_case() == 'Factory'
|
||||
methodDict['jniPath'] = self.jni_path
|
||||
|
||||
methodDict['return'] = self.translate_type(_method.returnType, jni=True, isReturn=True)
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ public {{#isLinphoneFactory}}abstract class{{/isLinphoneFactory}}{{#isNotLinphon
|
|||
public static final synchronized Factory instance() {
|
||||
try {
|
||||
if (_Factory == null) {
|
||||
_Factory = new FactoryImpl(0);
|
||||
_Factory = new FactoryImpl(0); // This value is not relevant, correct factory pointer will be used in JNI layer
|
||||
}
|
||||
} catch (Exception e) {
|
||||
System.err.println("Cannot instanciate factory");
|
||||
|
|
|
|||
|
|
@ -426,7 +426,9 @@ jobject Java_{{jni_package}}FactoryImpl_createCore(JNIEnv *env, jobject thiz, jo
|
|||
{{#methods}}
|
||||
{{#notEmpty}}
|
||||
{{return}} {{name}}({{params}}) {
|
||||
{{#notStatic}}{{classCName}} *cptr = ({{classCName}}*)ptr;{{/notStatic}}{{#strings}}
|
||||
{{#notStatic}}{{classCName}} *cptr = ({{classCName}}*)ptr;
|
||||
{{#isLinphoneFactory}}cptr = linphone_factory_get();{{/isLinphoneFactory}}
|
||||
{{/notStatic}}{{#strings}}
|
||||
const char* c_{{string}} = GetStringUTFChars(env, {{string}});
|
||||
{{/strings}}{{#bytes}}
|
||||
{{bytesargtype}} c_{{bytesargname}} = ({{bytesargtype}})env->GetByteArrayElements({{bytesargname}}, NULL);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue