<@U5FRVFK0E> commented on <@U3ZLHBTLG>’s file <htt...
# android
u
@myanmarking commented on @louiscad’s file https://kotlinlang.slack.com/files/U3ZLHBTLG/F5L2PTY6B/using_handler_without_leaks.kt:
Copy code
class TestClass{

    private lateinit var activityA: WeakReference<Activity>

    fun initActivity(){
        this.activityA.toWeakRef()
    }

    private fun <T> T.toWeakRef(): WeakReference<T> = WeakReference(this)
}