Oops, it seems there is still some kind of leak......
# korge
s
Oops, it seems there is still some kind of leak... I see that FPS gradually becomes lower and lower. What am I doing wrong?
Copy code
suspend fun main() = Korge {
    Logger.defaultLevel = Logger.Level.DEBUG

    val rect = Rectangle(0, 10, 20, 20)
    val g = graphics()

    addHrUpdater { delta ->
        log.debug { "FPS: ${ (1000 / delta.millisecondsDouble).roundToInt() }" }

        ++rect.x
        if (rect.x > 100) {
            rect.x = 0.0
        }

        g.apply {
            fill(Colors.BLACK) {
                rect(0.0, 0.0, this@Korge.width, this@Korge.height)
            }

            fill(Colors.YELLOW) {
                with(rect) { rect(x, y, width, height) }
            }
        }
    }
}