1 package com.example.leakcanary 2 3 import android.view.View 4 5 class LeakingThread : Thread() { 6 7 val leakedViews = mutableListOf<View>() 8 9 init { 10 name = "Leaking thread" 11 start() 12 } 13 runnull14 override fun run() { 15 synchronized(obj) { 16 obj.wait() 17 } 18 } 19 20 companion object { 21 private val obj = Object() 22 val thread = LeakingThread() 23 } 24 }