Add a switch to destroy runtime only on shutdown (#4482)
This commit is contained in:
committed by
Stanislav Erokhin
parent
37ff2c338e
commit
ee508efb23
@@ -13,4 +13,10 @@ fun writeToA(i: Int) {
|
||||
globalA.i = i
|
||||
}
|
||||
|
||||
fun readFromA() = globalA.i
|
||||
fun tryReadFromA(default: Int): Int {
|
||||
return try {
|
||||
globalA.i
|
||||
} catch (e: IncorrectDereferenceException) {
|
||||
default
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user