Documentation / listeners / com.femastudios.listeners / ListenersManager / addWeakly

addWeakly

abstract fun addWeakly(listener: Interface): Unit

Adds a listener, keeping a weak reference. This means that if nobody else keeps a pointer to the listener, it'll at some point automatically disposed by the Garbage Collector.