From be20c917ccf0d4e7cfe3b91ae52adfa74842eb69 Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Wed, 10 May 2023 10:28:44 +0300 Subject: [PATCH] 4.6.10-patch2 Resolved #9363 #9356 - solved font crash exception --- buildSrc/src/main/kotlin/BuildConfig.kt | 4 ++-- core/src/com/unciv/UncivGame.kt | 2 +- core/src/com/unciv/ui/components/Fonts.kt | 8 -------- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/buildSrc/src/main/kotlin/BuildConfig.kt b/buildSrc/src/main/kotlin/BuildConfig.kt index 2331464ec6..96a56354bb 100644 --- a/buildSrc/src/main/kotlin/BuildConfig.kt +++ b/buildSrc/src/main/kotlin/BuildConfig.kt @@ -3,8 +3,8 @@ package com.unciv.build object BuildConfig { const val kotlinVersion = "1.8.0" const val appName = "Unciv" - const val appCodeNumber = 863 - const val appVersion = "4.6.10-patch1" + const val appCodeNumber = 864 + const val appVersion = "4.6.10-patch2" const val gdxVersion = "1.11.0" const val roboVMVersion = "2.3.1" diff --git a/core/src/com/unciv/UncivGame.kt b/core/src/com/unciv/UncivGame.kt index 69d645ad63..995b04c4e7 100644 --- a/core/src/com/unciv/UncivGame.kt +++ b/core/src/com/unciv/UncivGame.kt @@ -531,7 +531,7 @@ open class UncivGame(val isConsoleMode: Boolean = false) : Game(), PlatformSpeci companion object { //region AUTOMATICALLY GENERATED VERSION DATA - DO NOT CHANGE THIS REGION, INCLUDING THIS COMMENT - val VERSION = Version("4.6.10-patch1", 863) + val VERSION = Version("4.6.10-patch2", 864) //endregion lateinit var Current: UncivGame diff --git a/core/src/com/unciv/ui/components/Fonts.kt b/core/src/com/unciv/ui/components/Fonts.kt index 53f0449b00..dba73282fd 100644 --- a/core/src/com/unciv/ui/components/Fonts.kt +++ b/core/src/com/unciv/ui/components/Fonts.kt @@ -197,7 +197,6 @@ object Fonts { lateinit var fontImplementation: FontImplementation lateinit var font: BitmapFont - var oldFont: BitmapFont? = null /** This resets all cached font data in object Fonts. * Do not call from normal code - reset the Skin instead: `BaseScreen.setSkin()` @@ -205,13 +204,6 @@ object Fonts { fun resetFont() { val settings = GUI.getSettings() fontImplementation.setFontFamily(settings.fontFamilyData, settings.getFontSize()) - if (::font.isInitialized) { - // We don't dispose the old font immediately since there may be objects using it. - // Instead, we wait for the *next* time the font is reset - since by then all usages of the old font should not exist either - #9338 - // Don't font.dispose() even it it seems obvious -> leaves only black rectangles - See #9325 - (oldFont?.data as? NativeBitmapFontData)?.dispose() - oldFont = font - } font = fontImplementation.getBitmapFont() font.data.markupEnabled = true }