Alexandr Miloslavskiy <alexandr.miloslavskiy {_AT_}>


r1880886 | hartmannathan | 2020-08-16 04:39:55 +0000 (Sun, 16 Aug 2020)

Fix crash in JavaHL JNI wrapper caused by object lifetimes

See dev@ email thread "JNI segfault while running Java tests" started
2020/08/08, archived at:

* subversion/bindings/javahl/native/jniwrapper/jni_string_map.hpp
  (Java::BaseImmutableMap::Entry::key): As the locally-scoped String::Contents
    object keeps a reference to a String, ensure the String will remain in
    scope for the lifetime of the String::Contents object by instantiating it
    as a local variable.

Reported by: jamessan

Patch by: Daniel Sahlberg <daniel.l.sahlberg {_AT_}>

Reviewed by: Alexandr Miloslavskiy <alexandr.miloslavskiy {_AT_}>

Tested by: jamessan