diff options
author | shivamv <shivam.v2@samsung.com> | 2022-09-30 16:51:59 +0530 |
---|---|---|
committer | shivamv <shivam.v2@samsung.com> | 2022-09-30 16:51:59 +0530 |
commit | 8e4d9c1e16f3391330b8db0f40a7b4bf1d7543e5 (patch) | |
tree | 42b08f13fa96ea1e258cccde388d6f808e513008 | |
parent | c38eec3e2d6f2e6be57934f5c3b49c46d425b618 (diff) | |
download | tray-8e4d9c1e16f3391330b8db0f40a7b4bf1d7543e5.tar.gz tray-8e4d9c1e16f3391330b8db0f40a7b4bf1d7543e5.tar.bz2 tray-8e4d9c1e16f3391330b8db0f40a7b4bf1d7543e5.zip |
Fixing SVACE handle leaks in tray and null deref check in Apps
Change-Id: I089a2c99aecb4b5e8d350489b3a04960fc9ff844
Signed-off-by: shivamv <shivam.v2@samsung.com>
-rwxr-xr-x | Apps/Models/AppInfoModel.cs | 14 | ||||
-rwxr-xr-x | Apps/ViewModels/AppInfoViewModel.cs | 6 | ||||
-rwxr-xr-x | TrayApplication/Models/AppInfoModel.cs | 2 | ||||
-rwxr-xr-x | packaging/org.tizen.Apps-1.0.0.tpk | bin | 59571 -> 59614 bytes | |||
-rwxr-xr-x | packaging/org.tizen.TrayApplication-1.0.0.tpk | bin | 5481668 -> 5481683 bytes |
5 files changed, 14 insertions, 8 deletions
diff --git a/Apps/Models/AppInfoModel.cs b/Apps/Models/AppInfoModel.cs index e7a301a..fa487df 100755 --- a/Apps/Models/AppInfoModel.cs +++ b/Apps/Models/AppInfoModel.cs @@ -35,16 +35,16 @@ namespace Apps.Models set => SetProperty(ref iconBackground, value); } - private void SetDefaultBackground() + private ImageVisual GetDefaultImageVisual() { ImageVisual imageVisual = new ImageVisual() { URL = Resources.GetImagePath() + "default_gradient.png", }; - IconBackground = imageVisual.OutputVisualMap; + return imageVisual; } - private void SetGradientBackground(PropertyArray stopColor) + private GradientVisual GetGradientVisual(PropertyArray stopColor) { GradientVisual gradientVisual = new GradientVisual() { @@ -53,7 +53,7 @@ namespace Apps.Models StopColor = stopColor, SpreadMethod = GradientVisualSpreadMethodType.Pad, }; - IconBackground = gradientVisual.OutputVisualMap; + return gradientVisual; } private PropertyArray GetGradientStopColors(Palette palette) @@ -124,12 +124,12 @@ namespace Apps.Models if (stopColor.Count() < 2) { Tizen.Log.Info(Resources.LogTag, "Palette or palatte values not valid, adding default gradient"); - SetDefaultBackground(); + IconBackground = GetDefaultImageVisual().OutputVisualMap; } else { - Tizen.Log.Info(Resources.LogTag, "setting palette color"); - SetGradientBackground(stopColor); + Tizen.Log.Info(Resources.LogTag, "setting palette color");
+ IconBackground = GetGradientVisual(stopColor).OutputVisualMap; } } } diff --git a/Apps/ViewModels/AppInfoViewModel.cs b/Apps/ViewModels/AppInfoViewModel.cs index 797cac0..0958e09 100755 --- a/Apps/ViewModels/AppInfoViewModel.cs +++ b/Apps/ViewModels/AppInfoViewModel.cs @@ -16,9 +16,13 @@ namespace Apps.ViewModels public void CreateData(IEnumerable<ApplicationInfo> list) { Clear(); + if(list == null)
+ {
+ return;
+ } foreach (ApplicationInfo appInfo in list) { - if (string.IsNullOrEmpty(appInfo.IconPath)) + if (appInfo == null || string.IsNullOrEmpty(appInfo.IconPath)) { continue; } diff --git a/TrayApplication/Models/AppInfoModel.cs b/TrayApplication/Models/AppInfoModel.cs index 13d917c..4d57ab9 100755 --- a/TrayApplication/Models/AppInfoModel.cs +++ b/TrayApplication/Models/AppInfoModel.cs @@ -55,6 +55,7 @@ namespace TrayApplication.Models URL = Resources.GetImagePath() + "default_gradient.png", }; IconBackground = imageVisual.OutputVisualMap; + imageVisual.Dispose(); } private void SetGradientBackground(PropertyArray stopColor) @@ -67,6 +68,7 @@ namespace TrayApplication.Models SpreadMethod = GradientVisualSpreadMethodType.Pad, }; IconBackground = gradientVisual.OutputVisualMap; + gradientVisual.Dispose(); } private PropertyArray GetGradientStopColors(Palette palette) diff --git a/packaging/org.tizen.Apps-1.0.0.tpk b/packaging/org.tizen.Apps-1.0.0.tpk Binary files differindex 14a309b..58bcbd4 100755 --- a/packaging/org.tizen.Apps-1.0.0.tpk +++ b/packaging/org.tizen.Apps-1.0.0.tpk diff --git a/packaging/org.tizen.TrayApplication-1.0.0.tpk b/packaging/org.tizen.TrayApplication-1.0.0.tpk Binary files differindex 7282e54..9effc77 100755 --- a/packaging/org.tizen.TrayApplication-1.0.0.tpk +++ b/packaging/org.tizen.TrayApplication-1.0.0.tpk |