Skip to content

Commit

Permalink
Add release_android_context on destroy (#860)
Browse files Browse the repository at this point in the history
  • Loading branch information
Baiker000 authored Jan 15, 2024
1 parent 60bbcac commit 25a8836
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changes/android-context-release.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"tao": patch
---

Fix the app crash on restart due to Android context was not released. Release the Android context when the app is destroyed to avoid assertion failure.
1 change: 1 addition & 0 deletions src/platform_impl/android/ndk_glue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ pub unsafe fn save(_: JNIEnv, _: JClass, _: JObject) {

pub unsafe fn destroy(_: JNIEnv, _: JClass, _: JObject) {
wake(Event::Destroy);
ndk_context::release_android_context();
}

pub unsafe fn memory(_: JNIEnv, _: JClass, _: JObject) {
Expand Down

0 comments on commit 25a8836

Please sign in to comment.