Fixing SVACE handle leak issues for Apps App. 99/282399/1
authorshivamv <shivam.v2@samsung.com>
Fri, 30 Sep 2022 18:44:37 +0000 (00:14 +0530)
committershivamv <shivam.v2@samsung.com>
Fri, 30 Sep 2022 18:44:37 +0000 (00:14 +0530)
Change-Id: I34b02bb68d3e5be8d543c0e2d003e750159e07ba
Signed-off-by: shivamv <shivam.v2@samsung.com>
Apps/Models/AppInfoModel.cs
Apps/ViewManager.cs [changed mode: 0644->0755]
Apps/ViewModels/AppInfoViewModel.cs
Apps/ViewModels/AppViewModel.cs [changed mode: 0644->0755]
Apps/Views/AppView.cs [changed mode: 0644->0755]
Apps/Views/CustomBorder.cs
packaging/org.tizen.Apps-1.0.0.tpk

index fa487dfd9c5ff2451899d3ca19d6656e1dfe9d75..2c7949b2b056a518eb1f67fafcfb7379677f610c 100755 (executable)
@@ -1,12 +1,14 @@
 using System;
 using System.Collections.Generic;
 using Tizen.NUI;
-using Tizen.Applications;
 using Apps.Common;
 namespace Apps.Models
 {
     class AppInfoModel : PropertyNotifier
-    {
+    {\r
+        private ImageVisual defaultVisual;
+        private GradientVisual gradientVisual;
+
         public AppInfoModel(string name, string applicationId, string url)
         {
             Name = name;
@@ -35,25 +37,23 @@ namespace Apps.Models
             set => SetProperty(ref iconBackground, value);
         }
 
-        private ImageVisual GetDefaultImageVisual()
+        private void SetDefaultImageVisual()
         {
-            ImageVisual imageVisual = new ImageVisual()
+            defaultVisual = new ImageVisual()
             {
                 URL = Resources.GetImagePath() + "default_gradient.png",
             };
-            return imageVisual;
         }
 
-        private GradientVisual GetGradientVisual(PropertyArray stopColor)
+        private void SetGradientVisual(PropertyArray stopColor)
         {
-            GradientVisual gradientVisual = new GradientVisual()
+            gradientVisual = new GradientVisual()
             {
                 StartPosition = new Vector2(0.0f, -1.0f),
                 EndPosition = new Vector2(0.0f, 1.0f),
                 StopColor = stopColor,
                 SpreadMethod = GradientVisualSpreadMethodType.Pad,
             };
-            return gradientVisual;
         }
 
         private PropertyArray GetGradientStopColors(Palette palette)
@@ -124,13 +124,26 @@ namespace Apps.Models
             if (stopColor.Count() < 2)
             {
                 Tizen.Log.Info(Resources.LogTag, "Palette or palatte values not valid, adding default gradient");
-                IconBackground = GetDefaultImageVisual().OutputVisualMap;
+                SetDefaultImageVisual();
+                IconBackground = defaultVisual.OutputVisualMap;
             }
             else
             {
                 Tizen.Log.Info(Resources.LogTag, "setting palette color");\r
-                IconBackground = GetGradientVisual(stopColor).OutputVisualMap;
+                SetGradientVisual(stopColor);\r
+                IconBackground = gradientVisual.OutputVisualMap;
             }
         }
+
+        ~AppInfoModel()\r
+        {\r
+            Tizen.Log.Info(Resources.LogTag, "Clearing NUI PropertyMap resources");\r
+            defaultVisual?.Dispose();\r
+            defaultVisual = null;\r
+            gradientVisual?.Dispose();\r
+            gradientVisual = null;\r
+            IconBackground?.Dispose();\r
+            IconBackground = null;\r
+        }
     }
 }
old mode 100644 (file)
new mode 100755 (executable)
index 468ec1a..29b7a3e
@@ -6,7 +6,6 @@ using System.IO;
 using Tizen.NUI;
 using Tizen.NUI.Xaml;
 using Tizen.Applications;
-using Tizen.NUI;
 using Apps.Common;
 using Apps.ViewModels;
 using Apps.Views;
index 0958e09b2b8436a5d5700e3b4f203677b03e027a..5db5d6d0410689e60ed5390740ef0b8bfdb6cef0 100755 (executable)
@@ -14,9 +14,9 @@ namespace Apps.ViewModels
         }
 
         public void CreateData(IEnumerable<ApplicationInfo> list)
-        {
+        {\r
             Clear();
-            if(list == null)\r
+            if (list == null)\r
             {\r
                 return;\r
             }
old mode 100644 (file)
new mode 100755 (executable)
index 9e088c7..870a76a
@@ -1,12 +1,9 @@
-using System;
-using System.Collections;
+using System.Collections;
 using System.Collections.Generic;
-using System.Text;
 using System.Windows.Input;
 using Tizen.Applications;
 using Tizen.NUI.Binding;
 using Apps.Common;
-using Apps.Models;
 
 namespace Apps.ViewModels
 {
old mode 100644 (file)
new mode 100755 (executable)
index dd98864..ff905a8
@@ -1,5 +1,4 @@
-using System.Collections;
-using System.Windows.Input;
+using System.Windows.Input;
 using Tizen.NUI;
 using Tizen.NUI.Components;
 using Tizen.NUI.BaseComponents;
@@ -40,7 +39,7 @@ namespace Apps.Views
                 return item;
             });
             Header = GetHeader();
-            this.SetBinding(CollectionView.ItemsSourceProperty, "AppListSource");
+            this.SetBinding(ItemsSourceProperty, "AppListSource");
             this.SetBinding(AppSelectCommandProperty, "AppSelectCommand");
 
             SelectionChanged += OnAppSelection;
index 0cecea87eb827a9467f662ca962315573bc592c6..41c43bc4dd326842467f997ee0b188882a24e6e1 100755 (executable)
@@ -1,11 +1,7 @@
-using System;\r
-using System.Collections.Generic;\r
-using System.Text;\r
-using Tizen;\r
-using Tizen.NUI;\r
-using Tizen.NUI.Components;\r
+using Tizen.NUI;\r
 using Tizen.NUI.BaseComponents;\r
 using Apps.Common;\r
+\r
 namespace Apps.Views\r
 {\r
     class CustomBorder : DefaultBorder\r
index 58bcbd4306ad2e9c8a4831213191e106819bd58a..0d0c2476277c2e30ba732a5d38d503164ddfea86 100755 (executable)
Binary files a/packaging/org.tizen.Apps-1.0.0.tpk and b/packaging/org.tizen.Apps-1.0.0.tpk differ