diff --git a/doc/changes/misc_features/mr.1655.md b/doc/changes/misc_features/mr.1655.md index f9d0651fd..981a1df6e 100644 --- a/doc/changes/misc_features/mr.1655.md +++ b/doc/changes/misc_features/mr.1655.md @@ -1 +1,4 @@ +--- +- mr.2392 +--- Handle Android activity lifecycle. diff --git a/src/xrt/auxiliary/android/android_instance_base.c b/src/xrt/auxiliary/android/android_instance_base.c index 1de84514d..2e2bcd881 100644 --- a/src/xrt/auxiliary/android/android_instance_base.c +++ b/src/xrt/auxiliary/android/android_instance_base.c @@ -149,6 +149,11 @@ android_instance_base_init(struct android_instance_base *aib, void android_instance_base_cleanup(struct android_instance_base *aib, struct xrt_instance *xinst) { + if (xinst->android_instance == NULL) { + // Already cleaned up or never initialized. + return; + } + assert(&(aib->base) == xinst->android_instance); android_lifecycle_callbacks_destroy(&aib->lifecycle_callbacks);