summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshivamv <shivam.v2@samsung.com>2022-10-01 00:14:37 +0530
committershivamv <shivam.v2@samsung.com>2022-10-01 00:14:37 +0530
commit22231df5c96ac80cf1ad765c94fd1b5a194d60ef (patch)
tree07add6ce515b879847871db4edabe14f1dc8780f
parent8e4d9c1e16f3391330b8db0f40a7b4bf1d7543e5 (diff)
downloadtray-22231df5c96ac80cf1ad765c94fd1b5a194d60ef.tar.gz
tray-22231df5c96ac80cf1ad765c94fd1b5a194d60ef.tar.bz2
tray-22231df5c96ac80cf1ad765c94fd1b5a194d60ef.zip
Fixing SVACE handle leak issues for Apps App.
Change-Id: I34b02bb68d3e5be8d543c0e2d003e750159e07ba Signed-off-by: shivamv <shivam.v2@samsung.com>
-rwxr-xr-xApps/Models/AppInfoModel.cs33
-rwxr-xr-x[-rw-r--r--]Apps/ViewManager.cs1
-rwxr-xr-xApps/ViewModels/AppInfoViewModel.cs4
-rwxr-xr-x[-rw-r--r--]Apps/ViewModels/AppViewModel.cs5
-rwxr-xr-x[-rw-r--r--]Apps/Views/AppView.cs5
-rwxr-xr-xApps/Views/CustomBorder.cs8
-rwxr-xr-xpackaging/org.tizen.Apps-1.0.0.tpkbin59614 -> 59745 bytes
7 files changed, 30 insertions, 26 deletions
diff --git a/Apps/Models/AppInfoModel.cs b/Apps/Models/AppInfoModel.cs
index fa487df..2c7949b 100755
--- a/Apps/Models/AppInfoModel.cs
+++ b/Apps/Models/AppInfoModel.cs
@@ -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
- {
+ {
+ 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");
- IconBackground = GetGradientVisual(stopColor).OutputVisualMap;
+ SetGradientVisual(stopColor);
+ IconBackground = gradientVisual.OutputVisualMap;
}
}
+
+ ~AppInfoModel()
+ {
+ Tizen.Log.Info(Resources.LogTag, "Clearing NUI PropertyMap resources");
+ defaultVisual?.Dispose();
+ defaultVisual = null;
+ gradientVisual?.Dispose();
+ gradientVisual = null;
+ IconBackground?.Dispose();
+ IconBackground = null;
+ }
}
}
diff --git a/Apps/ViewManager.cs b/Apps/ViewManager.cs
index 468ec1a..29b7a3e 100644..100755
--- a/Apps/ViewManager.cs
+++ b/Apps/ViewManager.cs
@@ -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;
diff --git a/Apps/ViewModels/AppInfoViewModel.cs b/Apps/ViewModels/AppInfoViewModel.cs
index 0958e09..5db5d6d 100755
--- a/Apps/ViewModels/AppInfoViewModel.cs
+++ b/Apps/ViewModels/AppInfoViewModel.cs
@@ -14,9 +14,9 @@ namespace Apps.ViewModels
}
public void CreateData(IEnumerable<ApplicationInfo> list)
- {
+ {
Clear();
- if(list == null)
+ if (list == null)
{
return;
}
diff --git a/Apps/ViewModels/AppViewModel.cs b/Apps/ViewModels/AppViewModel.cs
index 9e088c7..870a76a 100644..100755
--- a/Apps/ViewModels/AppViewModel.cs
+++ b/Apps/ViewModels/AppViewModel.cs
@@ -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
{
diff --git a/Apps/Views/AppView.cs b/Apps/Views/AppView.cs
index dd98864..ff905a8 100644..100755
--- a/Apps/Views/AppView.cs
+++ b/Apps/Views/AppView.cs
@@ -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;
diff --git a/Apps/Views/CustomBorder.cs b/Apps/Views/CustomBorder.cs
index 0cecea8..41c43bc 100755
--- a/Apps/Views/CustomBorder.cs
+++ b/Apps/Views/CustomBorder.cs
@@ -1,11 +1,7 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using Tizen;
-using Tizen.NUI;
-using Tizen.NUI.Components;
+using Tizen.NUI;
using Tizen.NUI.BaseComponents;
using Apps.Common;
+
namespace Apps.Views
{
class CustomBorder : DefaultBorder
diff --git a/packaging/org.tizen.Apps-1.0.0.tpk b/packaging/org.tizen.Apps-1.0.0.tpk
index 58bcbd4..0d0c247 100755
--- a/packaging/org.tizen.Apps-1.0.0.tpk
+++ b/packaging/org.tizen.Apps-1.0.0.tpk
Binary files differ