Hi @amitshekhariitbhu! Thank you for building this great library.
I am running into memory leak issue with ANRequest#getAsJSONObject when the listener I supplied contains references to destroyed lifecycle objects. I am hoping to convert our callsite to suspend functions using [suspendCancellableCoroutine](https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/suspend-cancellable-coroutine.html) and use something continuation.invokeOnCancellation { request.unregister(callback) } in order to prevent memory leak and unnecessary callback execution when the lifecycle object is dead. However, I don't see an api to unregister requestListener in ANRequest. Do you think this would be something that is safe to add? I'm happy to help if you don't have bandwidth. Thanks!
Hi @amitshekhariitbhu! Thank you for building this great library.
I am running into memory leak issue with
ANRequest#getAsJSONObject
when the listener I supplied contains references to destroyed lifecycle objects. I am hoping to convert our callsite to suspend functions using[suspendCancellableCoroutine](https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/suspend-cancellable-coroutine.html)
and use somethingcontinuation.invokeOnCancellation { request.unregister(callback) }
in order to prevent memory leak and unnecessary callback execution when the lifecycle object is dead. However, I don't see an api to unregister requestListener in ANRequest. Do you think this would be something that is safe to add? I'm happy to help if you don't have bandwidth. Thanks!