Native, old MM: fix releasing foreign refs to circular frozen graphs

^KT-49497
This commit is contained in:
Svyatoslav Scherbina
2021-12-10 10:09:49 +03:00
committed by Space
parent b82c306530
commit 2bd53e3dea
6 changed files with 74 additions and 4 deletions
@@ -896,6 +896,17 @@ fun testRememberNewObject(test: TestRememberNewObject) {
assertNotEquals("", obj.toString()) // Likely crashes if object is removed.
}
class KT49497Model {
private class SelfRef(val self: KT49497Model)
// Wrapping `this` to make the strongly connected component non-trival, just in case:
private val selfRef = SelfRef(this)
init {
freeze()
}
}
open class ClassForTypeCheck
fun testClassTypeCheck(x: Any) = x is ClassForTypeCheck