From 86d9d784f04dc348b2093762af1dd94883589879 Mon Sep 17 00:00:00 2001 From: Inhong Han Date: Tue, 9 Jan 2024 16:45:35 +0900 Subject: [PATCH] Fix issue detected by static analysis tool Change-Id: I9ddd8b2bc1399a0115dbd1d40effe4c69dddcc10 --- Settings/SettingInputmethod/SettingDefaultKeyboard.cs | 8 +++++++- Settings/SettingInputmethod/SettingWidgetInputmethod.cs | 4 +++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Settings/SettingInputmethod/SettingDefaultKeyboard.cs b/Settings/SettingInputmethod/SettingDefaultKeyboard.cs index 1114ba9..227e3b6 100644 --- a/Settings/SettingInputmethod/SettingDefaultKeyboard.cs +++ b/Settings/SettingInputmethod/SettingDefaultKeyboard.cs @@ -16,6 +16,7 @@ namespace SettingInputmethod private static List labelList; private int currentIndex = -1; private int pickerIndex = 0; + static AppBarStyle appBarStyle; public SettingDefaultKeyboard(Window parentWindow) : base() { @@ -106,7 +107,7 @@ namespace SettingInputmethod AutoNavigationContent = false, }; - AppBarStyle appBarStyle = (AppBarStyle)ThemeManager.GetStyle("Tizen.NUI.Components.AppBar"); + appBarStyle = (AppBarStyle)ThemeManager.GetStyle("Tizen.NUI.Components.AppBar"); Button backButton = new Button(((AppBarStyle)appBarStyle).BackButton); appBar.NavigationContent = backButton; @@ -119,6 +120,11 @@ namespace SettingInputmethod Content = root; } + ~SettingDefaultKeyboard() + { + appBarStyle?.Dispose(); + } + private void onValueChanged(object sender, ValueChangedEventArgs e) { Log.Debug(LogTag, "current index : " + e.Value.ToString()); diff --git a/Settings/SettingInputmethod/SettingWidgetInputmethod.cs b/Settings/SettingInputmethod/SettingWidgetInputmethod.cs index e3b84a2..07c2271 100644 --- a/Settings/SettingInputmethod/SettingWidgetInputmethod.cs +++ b/Settings/SettingInputmethod/SettingWidgetInputmethod.cs @@ -18,6 +18,7 @@ namespace SettingInputmethod static SettingItem defaultKeyboard; static int keyboardCount; static List installedKeyboards = new List(); + static AppBarStyle appBarStyle; protected override void OnCreate(string contentInfo, Window window) { @@ -78,7 +79,7 @@ namespace SettingInputmethod AutoNavigationContent = false, }; - AppBarStyle appBarStyle = (AppBarStyle)ThemeManager.GetStyle("Tizen.NUI.Components.AppBar"); + appBarStyle = (AppBarStyle)ThemeManager.GetStyle("Tizen.NUI.Components.AppBar"); Button backButton = new Button(((AppBarStyle)appBarStyle).BackButton); backButton.Clicked += (object source, ClickedEventArgs args) => @@ -194,6 +195,7 @@ namespace SettingInputmethod protected override void OnTerminate(string contentInfo, TerminationType type) { + appBarStyle?.Dispose(); base.OnTerminate(contentInfo, type); } -- 2.34.1