From: Inhong Han Date: Tue, 9 Jan 2024 07:45:35 +0000 (+0900) Subject: Fix issue detected by static analysis tool X-Git-Tag: accepted/tizen/8.0/unified/20240111.160636~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=86d9d784f04dc348b2093762af1dd94883589879;p=profile%2Fiot%2Fapps%2Fdotnet%2Fsetting-inputmethod.git Fix issue detected by static analysis tool Change-Id: I9ddd8b2bc1399a0115dbd1d40effe4c69dddcc10 --- 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); }