utopia-rise / godot-kotlin-native

Kotlin bindings for Godot Engine
MIT License
290 stars 16 forks source link

Rework noInitZone #234

Closed raniejade closed 4 years ago

raniejade commented 4 years ago

This ensures that noInitZone only affects the first call to shouldInitPtr. Previously this was causing issues with object properties not being initialized.

class MyScript : Spatial() {
    val label = Label()
}

The problem here is when Label() is called it is still within the noInitZone, causing the underlying ptr to be not initialized.