Reputation: 29
This is for Android/Java implementation of Firebase Database.
If RemoveEventListener is called from the main thread is it guaranteed the listener function will not surface afterwards? Since the process behind Firebase is most likely multi-threaded, the concern is that a listener callback may be scheduled before removal of the event listener takes place...
OnPause()
{
ref.RemoveEventListener(listener);
//safe to destroy objects referenced by listener here???
}
Upvotes: 0
Views: 30
Reputation: 317958
The thread that you use to call removeEventListener
doesn't really matter, though it's expected that you're likely using the main thread to do so. It will do what it says in the API documentation, and the listener will not be invoked again.
Upvotes: 1