The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

jnipp: Catch and handle exception in object destructor

+8 -2
+8 -2
src/external/jnipp/jnipp.cpp
··· 306 306 307 307 Object::~Object() noexcept 308 308 { 309 - JNIEnv* env = jni::env(); 309 + JNIEnv* env; 310 + try { 311 + env = jni::env(); 312 + } catch (const jni::InitializationException &) { 313 + // Better be empty. Cannot do anything useful. 314 + return; 315 + } 310 316 311 - if (_isGlobal) 317 + if (_isGlobal && _handle != nullptr) 312 318 env->DeleteGlobalRef(_handle); 313 319 314 320 if (_class != nullptr)