From bc81d57a94712c99379b4fdb990e484be1916d9e Mon Sep 17 00:00:00 2001 From: gotoextreme Date: Mon, 16 Jul 2018 15:27:54 +0900 Subject: [PATCH] Fix handle leak (#333) * Fix handle leak Signed-off-by: hyunho * Update NotificationReplyAction.cs --- .../NotificationReplyAction.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationReplyAction.cs b/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationReplyAction.cs index 38cd443e0..80b4908bc 100755 --- a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationReplyAction.cs +++ b/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationReplyAction.cs @@ -104,12 +104,14 @@ namespace Tizen.Applications.Notifications } } - Bundle bundle = new Bundle(); - bundle.AddItem(replyKey, ((int)this.ParentIndex).ToString()); - Interop.Notification.SetExtensionData(notification.Handle, replyKey, bundle.SafeBundleHandle); - + using (Bundle bundle = new Bundle()) + { + bundle.AddItem(replyKey, ((int)this.ParentIndex).ToString()); + Interop.Notification.SetExtensionData(notification.Handle, replyKey, bundle.SafeBundleHandle); + } Interop.Notification.SetPlaceHolderLength(notification.Handle, this.ReplyMax); Interop.Notification.SetText(notification.Handle, NotificationText.PlaceHolder, PlaceHolderText, null, -1); + } } } -- 2.34.1