From 8f723ef8b63738ffe6f7c76659df27e5ecfe6ee5 Mon Sep 17 00:00:00 2001 From: Igor Demin Date: Tue, 26 Jan 2021 13:05:09 +0300 Subject: [PATCH] Close windows in `finally` in refresh rate test --- .../org/jetbrains/skiko/SkiaWindowPerformanceTest.kt | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/samples/SkijaInjectSample/src/test/kotlin/org/jetbrains/skiko/SkiaWindowPerformanceTest.kt b/samples/SkijaInjectSample/src/test/kotlin/org/jetbrains/skiko/SkiaWindowPerformanceTest.kt index 3f452074a..ecd61bc2a 100644 --- a/samples/SkijaInjectSample/src/test/kotlin/org/jetbrains/skiko/SkiaWindowPerformanceTest.kt +++ b/samples/SkijaInjectSample/src/test/kotlin/org/jetbrains/skiko/SkiaWindowPerformanceTest.kt @@ -138,10 +138,13 @@ native crash in SkiaWindowTest "render single window" } } delay(1000) - windows.forEach(TestWindow::startCollect) - awaitFrameCollection(windows) - windows.forEach(TestWindow::printInfo) - windows.forEach(TestWindow::close) + try { + windows.forEach(TestWindow::startCollect) + awaitFrameCollection(windows) + windows.forEach(TestWindow::printInfo) + } finally { + windows.forEach(TestWindow::close) + } } // TODO fix native crash on macOs in previous test if this test is performed before it