Merge branch 'asibross-master' into director-smartptr-ownership
* asibross-master: Missing smart pointer handling in Java director extra methods implementation. Conflicts: Source/Modules/java.cxx
This commit is contained in:
commit
a2d65ca3bb
1 changed files with 12 additions and 2 deletions
|
|
@ -3755,8 +3755,18 @@ public:
|
|||
Printf(code_wrap->def,
|
||||
"SWIGEXPORT void JNICALL Java_%s%s_%s(JNIEnv *jenv, jclass jcls, jobject jself, jlong objarg, jboolean jtake_or_release) {\n",
|
||||
jnipackage, jni_imclass_name, changeown_jnimethod_name);
|
||||
Printf(code_wrap->code, " %s *obj = *((%s **)&objarg);\n", norm_name, norm_name);
|
||||
Printf(code_wrap->code, " %s *director = static_cast<%s *>(obj);\n", dirClassName, dirClassName);
|
||||
|
||||
if (Len(smartptr)) {
|
||||
Printf(code_wrap->code, " %s *obj = *((%s **)&objarg);\n", smartptr, smartptr);
|
||||
Printf(code_wrap->code, " // Keep a local instance of the smart pointer around while we are using the raw pointer\n");
|
||||
Printf(code_wrap->code, " // Avoids using smart pointer specific API.\n");
|
||||
Printf(code_wrap->code, " %s *director = static_cast<%s *>(obj->operator->());\n", dirClassName, dirClassName);
|
||||
}
|
||||
else {
|
||||
Printf(code_wrap->code, " %s *obj = *((%s **)&objarg);\n", norm_name, norm_name);
|
||||
Printf(code_wrap->code, " %s *director = static_cast<%s *>(obj);\n", dirClassName, dirClassName);
|
||||
}
|
||||
|
||||
Printf(code_wrap->code, " (void)jcls;\n");
|
||||
Printf(code_wrap->code, " director->swig_java_change_ownership(jenv, jself, jtake_or_release ? true : false);\n");
|
||||
Printf(code_wrap->code, "}\n");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue