swig/Lib/java
William S Fulton ea1b6e8ed5 Memory leak in java directors when passing byte arrays (char*, size_t)
When passing a byte array from c++ to Java using the director feature, the generated jni code does not release a temporary byte array.

This is the typemap specified in Java.swg:

    %typemap(directorin, descriptor="[B") (char *STRING, size_t LENGTH) {
    jbyteArray jb = (jenv)->NewByteArray($2);
    (jenv)->SetByteArrayRegion(jb, 0, $2, (jbyte *)$1);
    $input = jb;
    }

    %typemap(directorargout) (char *STRING, size_t LENGTH)
    %{(jenv)->GetByteArrayRegion($input, 0, $2, (jbyte *)$1); %}

Notice that the call to NewByteArray doesn't contain a symmetric release logic as the SetByteArrayRegion/GetByteArrayRegion does.

Closes #386
2015-04-23 19:17:35 +01:00
..
arrays_java.i Make generated support functions in arrays_java.i static for multiple module linking 2012-02-16 07:14:18 +00:00
boost_intrusive_ptr.i Convert to unix fileformat 2013-01-12 16:54:37 +00:00
boost_shared_ptr.i Fix for SourceForge Bug #1283. 2013-01-04 00:31:55 +00:00
director.swg Fix multiple definitions of 'ExceptionMatches' when using directors and multiple modules. 2015-04-11 22:51:29 +01:00
enums.swg Java enums - remove redundant typemaps 2014-03-28 07:45:23 +00:00
enumsimple.swg The 'directorin' typemap now accepts , etc expansions instead of having to use workarounds - _name, _name etc. 2011-12-21 07:16:44 +00:00
enumtypesafe.swg Java enums - remove redundant typemaps 2014-03-28 07:45:23 +00:00
enumtypeunsafe.swg The 'directorin' typemap now accepts , etc expansions instead of having to use workarounds - _name, _name etc. 2011-12-21 07:16:44 +00:00
java.swg Memory leak in java directors when passing byte arrays (char*, size_t) 2015-04-23 19:17:35 +01:00
javahead.swg SWIG license change - The Examples and Lib move to a very permissive license in the LICENSE file, removing the BSD license restrictions as agreed by committers since it was inadvertently introduced. Remove some examples where the impact of the license change is not clear. 2010-02-27 23:26:02 +00:00
javakw.swg Add R keyword support. Rename keywords for successful compilation of Java and C# code. More consistent keyword warnings across the different languages. 2008-06-19 20:02:13 +00:00
std_auto_ptr.i Add std_auto_ptr.i defining typemaps for returning std::auto_ptr<>. 2013-12-03 23:45:20 +01:00
std_common.i const size_t& typemaps added 2006-10-17 21:43:40 +00:00
std_deque.i Each target language now has its own std_deque.i like the other STL wrappers. 2006-01-08 20:08:44 +00:00
std_except.i SWIG license change - The Examples and Lib move to a very permissive license in the LICENSE file, removing the BSD license restrictions as agreed by committers since it was inadvertently introduced. Remove some examples where the impact of the license change is not clear. 2010-02-27 23:26:02 +00:00
std_map.i remove std::map specializations - not needed since the typemap matching rules were changed to follow type deducation used in template specialization 2010-04-04 20:37:20 +00:00
std_pair.i SWIG license change - The Examples and Lib move to a very permissive license in the LICENSE file, removing the BSD license restrictions as agreed by committers since it was inadvertently introduced. Remove some examples where the impact of the license change is not clear. 2010-02-27 23:26:02 +00:00
std_shared_ptr.i Add std_shared_ptr.i and document shared_ptr library 2010-06-01 19:03:55 +00:00
std_string.i Use more conventional naming for generated Java LocalRefGuard variables 2014-09-27 14:32:03 +01:00
std_vector.i Work around differences in clang libc++ std::vector<bool>::const_reference 2014-02-04 16:00:12 -05:00
std_wstring.i SWIG license change - The Examples and Lib move to a very permissive license in the LICENSE file, removing the BSD license restrictions as agreed by committers since it was inadvertently introduced. Remove some examples where the impact of the license change is not clear. 2010-02-27 23:26:02 +00:00
stl.i SWIG license change - The Examples and Lib move to a very permissive license in the LICENSE file, removing the BSD license restrictions as agreed by committers since it was inadvertently introduced. Remove some examples where the impact of the license change is not clear. 2010-02-27 23:26:02 +00:00
typemaps.i Fix typecheck OUTPUT typemaps for Java 2013-04-10 18:37:26 +01:00
various.i Doc/comment improvements in Java various.i 2014-08-04 19:22:02 +01:00