mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-01-29 18:08:29 +00:00
jnipp: Catch and handle exception in object destructor
This commit is contained in:
parent
1a76677800
commit
2453c1b2de
10
src/external/jnipp/jnipp.cpp
vendored
10
src/external/jnipp/jnipp.cpp
vendored
|
@ -306,9 +306,15 @@ namespace jni
|
|||
|
||||
Object::~Object() noexcept
|
||||
{
|
||||
JNIEnv* env = jni::env();
|
||||
JNIEnv* env;
|
||||
try {
|
||||
env = jni::env();
|
||||
} catch (const jni::InitializationException &) {
|
||||
// Better be empty. Cannot do anything useful.
|
||||
return;
|
||||
}
|
||||
|
||||
if (_isGlobal)
|
||||
if (_isGlobal && _handle != nullptr)
|
||||
env->DeleteGlobalRef(_handle);
|
||||
|
||||
if (_class != nullptr)
|
||||
|
|
Loading…
Reference in a new issue