You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem with new JavaObject(obj).Handle is that there is a window wherein the JavaObject is collected after the .Handle property is accessed, but before.Handle is returned to Java code, which would "normally" keep the JavaObject instance alive.
Activity
jonpryor commentedon Dec 10, 2020
Should likewise audit the rest of the codebase to check for places where
GC.KeepAlive()is needed. :-(jonpryor commentedon Dec 18, 2020
Mono.Android.Exportlikely needs to be updated to insertGC.KeepAlive()calls in the generated marshal methods.[Mono.Android] Prevent premature JNI handle collection (#12315)
[Mono.Android] Address review feedback on threshold removal
[Mono.Android] Address review feedback on threshold removal
[Mono.Android] Address review feedback on threshold removal