Fix issue detected by static analysis tool 32/304032/1
authorInhong Han <inhong1.han@samsung.com>
Tue, 9 Jan 2024 07:45:35 +0000 (16:45 +0900)
committerInhong Han <inhong1.han@samsung.com>
Tue, 9 Jan 2024 07:45:35 +0000 (16:45 +0900)
Change-Id: I9ddd8b2bc1399a0115dbd1d40effe4c69dddcc10

Settings/SettingInputmethod/SettingDefaultKeyboard.cs
Settings/SettingInputmethod/SettingWidgetInputmethod.cs

index 1114ba9cb1fa8c45923f73576f5ad1a262ca1b18..227e3b644113f1f5584fc9184c52953652a173e4 100644 (file)
@@ -16,6 +16,7 @@ namespace SettingInputmethod
         private static List<string> labelList;\r
         private int currentIndex = -1;\r
         private int pickerIndex = 0;\r
+        static AppBarStyle appBarStyle;\r
 \r
         public SettingDefaultKeyboard(Window parentWindow) : base()\r
         {\r
@@ -106,7 +107,7 @@ namespace SettingInputmethod
                 AutoNavigationContent = false,\r
             };\r
 \r
-            AppBarStyle appBarStyle = (AppBarStyle)ThemeManager.GetStyle("Tizen.NUI.Components.AppBar");\r
+            appBarStyle = (AppBarStyle)ThemeManager.GetStyle("Tizen.NUI.Components.AppBar");\r
             Button backButton = new Button(((AppBarStyle)appBarStyle).BackButton);\r
             appBar.NavigationContent = backButton;\r
 \r
@@ -119,6 +120,11 @@ namespace SettingInputmethod
             Content = root;\r
         }\r
 \r
+        ~SettingDefaultKeyboard()\r
+        {\r
+            appBarStyle?.Dispose();\r
+        }\r
+\r
         private void onValueChanged(object sender, ValueChangedEventArgs e)\r
         {\r
             Log.Debug(LogTag, "current index : " + e.Value.ToString());\r
index e3b84a28d7b468910a055ff6bced4efbe94617d2..07c2271d3d5fa835bd8893b9581ad926f9354890 100644 (file)
@@ -18,6 +18,7 @@ namespace SettingInputmethod
         static SettingItem defaultKeyboard;\r
         static int keyboardCount;\r
         static List<SettingItem> installedKeyboards = new List<SettingItem>();\r
+        static AppBarStyle appBarStyle;\r
 \r
         protected override void OnCreate(string contentInfo, Window window)\r
         {\r
@@ -78,7 +79,7 @@ namespace SettingInputmethod
                 AutoNavigationContent = false,\r
             };\r
 \r
-            AppBarStyle appBarStyle = (AppBarStyle)ThemeManager.GetStyle("Tizen.NUI.Components.AppBar");\r
+            appBarStyle = (AppBarStyle)ThemeManager.GetStyle("Tizen.NUI.Components.AppBar");\r
             Button backButton = new Button(((AppBarStyle)appBarStyle).BackButton);\r
 \r
             backButton.Clicked += (object source, ClickedEventArgs args) =>\r
@@ -194,6 +195,7 @@ namespace SettingInputmethod
 \r
         protected override void OnTerminate(string contentInfo, TerminationType type)\r
         {\r
+            appBarStyle?.Dispose();\r
             base.OnTerminate(contentInfo, type);\r
         }\r
 \r