summaryrefslogtreecommitdiff
path: root/Tizen.Applications.Common
diff options
context:
space:
mode:
authors89.jang <s89.jang@samsung.com>2017-03-20 16:33:38 +0900
committerSangyoon Jang <s89.jang@samsung.com>2017-03-20 00:57:29 -0700
commitd5dbddafdcba3ef2904fa7a283c27039927dd755 (patch)
treee98a5222a189c1b6e73f502341024b1995836630 /Tizen.Applications.Common
parent5f5fc92a5dc545d155821b5b8bab267a93d4ec7b (diff)
downloadapplication-d5dbddafdcba3ef2904fa7a283c27039927dd755.tar.gz
application-d5dbddafdcba3ef2904fa7a283c27039927dd755.tar.bz2
application-d5dbddafdcba3ef2904fa7a283c27039927dd755.zip
Fix a static analyzer issue
Use using statement to call Dispose() properly. Change-Id: Iafc78925819f0c40f45ee8d23cf8b891d3c9c718 Signed-off-by: s89.jang <s89.jang@samsung.com>
Diffstat (limited to 'Tizen.Applications.Common')
-rw-r--r--Tizen.Applications.Common/Tizen.Applications/ApplicationManager.cs16
1 files changed, 9 insertions, 7 deletions
diff --git a/Tizen.Applications.Common/Tizen.Applications/ApplicationManager.cs b/Tizen.Applications.Common/Tizen.Applications/ApplicationManager.cs
index 1644e16..ea2dd74 100644
--- a/Tizen.Applications.Common/Tizen.Applications/ApplicationManager.cs
+++ b/Tizen.Applications.Common/Tizen.Applications/ApplicationManager.cs
@@ -329,14 +329,16 @@ namespace Tizen.Applications
{
throw ApplicationManagerErrorFactory.GetException(err, "Failed to register the application context event.");
}
- ApplicationRunningContext context = new ApplicationRunningContext(clonedHandle);
- if (state == Interop.ApplicationManager.AppContextEvent.Launched)
+ using (ApplicationRunningContext context = new ApplicationRunningContext(clonedHandle))
{
- s_launchedHandler?.Invoke(null, new ApplicationLaunchedEventArgs { ApplicationRunningContext = context });
- }
- else if (state == Interop.ApplicationManager.AppContextEvent.Terminated)
- {
- s_terminatedHandler?.Invoke(null, new ApplicationTerminatedEventArgs { ApplicationRunningContext = context });
+ if (state == Interop.ApplicationManager.AppContextEvent.Launched)
+ {
+ s_launchedHandler?.Invoke(null, new ApplicationLaunchedEventArgs { ApplicationRunningContext = context });
+ }
+ else if (state == Interop.ApplicationManager.AppContextEvent.Terminated)
+ {
+ s_terminatedHandler?.Invoke(null, new ApplicationTerminatedEventArgs { ApplicationRunningContext = context });
+ }
}
};
err = Interop.ApplicationManager.AppManagerSetAppContextEvent(s_applicationChangedEventCallback, IntPtr.Zero);