From 3f0d00a5d307fdd0878ecf1d49c249d8c06f3f0c Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Tue, 31 Oct 2006 21:58:23 +0000 Subject: [PATCH] - pgcpp fix for const methods - DeleteLocalRef removed from end of director methods - it causes crashes on Solaris git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@9493 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Source/Modules/java.cxx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Source/Modules/java.cxx b/Source/Modules/java.cxx index 96051c150..96f700702 100644 --- a/Source/Modules/java.cxx +++ b/Source/Modules/java.cxx @@ -1947,17 +1947,22 @@ class JAVA : public Language { Printv(imcall, imclass_name, ".", intermediary_function_name, "(", NIL); if (!static_flag) { Printf(imcall, "swigCPtr"); + String *this_type = Copy(getClassType()); String *name = NewString("self"); + String *qualifier = Getattr(n, k_qualifier); + if (qualifier) + SwigType_push(this_type, qualifier); SwigType_add_pointer(this_type); Parm *this_parm = NewParm(this_type, name); Swig_typemap_attach_parms("jtype", this_parm, NULL); if (prematureGarbageCollectionPreventionParameter(this_type, this_parm)) Printf(imcall, ", this"); + + Delete(this_parm); Delete(name); Delete(this_type); - Delete(this_parm); } emit_mark_varargs(l); @@ -3567,7 +3572,9 @@ class JAVA : public Language { Printf(w->code, "SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, \"null upcall object\");\n"); Printf(w->code, "}\n"); + /* This makes all the director methods segfault on Solaris 8 Printf(w->code, "if (jobj) jenv->DeleteLocalRef(jobj);\n"); + */ if (!is_void) Printf(w->code, "return %s;", qualified_return);