From 0c5c4cb0e3af66fc7641d1ed93afa5a24f3b29b8 Mon Sep 17 00:00:00 2001 From: jeremy-jang <35089715+jeremy-jang@users.noreply.github.com> Date: Fri, 13 Mar 2020 18:08:32 +0900 Subject: [PATCH] [Packagemanager] Fix creating internal callback delgate (#1462) Create internal callback delegate once for prevent invoking callback after garbage-collected in unmanaged code. Change-Id: I18884c09891cca4495576336496206d28067836a Signed-off-by: Sangyoon Jang --- .../Tizen.Applications/PackageManager.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) mode change 100644 => 100755 src/Tizen.Applications.PackageManager/Tizen.Applications/PackageManager.cs diff --git a/src/Tizen.Applications.PackageManager/Tizen.Applications/PackageManager.cs b/src/Tizen.Applications.PackageManager/Tizen.Applications/PackageManager.cs old mode 100644 new mode 100755 index 1d48fb1..29bfc2d --- a/src/Tizen.Applications.PackageManager/Tizen.Applications/PackageManager.cs +++ b/src/Tizen.Applications.PackageManager/Tizen.Applications/PackageManager.cs @@ -42,7 +42,7 @@ namespace Tizen.Applications private static event EventHandler s_clearDataEventHandler; private static readonly object s_pkgEventLock = new object(); - private static Interop.PackageManager.PackageManagerEventCallback s_packageManagerEventCallback; + private static Interop.PackageManager.PackageManagerEventCallback s_packageManagerEventCallback = new Interop.PackageManager.PackageManagerEventCallback(InternalEventCallback); private static Dictionary s_totalSizeInfoCallbackDict = new Dictionary(); private static int s_callbackId = 0; @@ -1170,7 +1170,6 @@ namespace Tizen.Applications return; var err = Interop.PackageManager.ErrorCode.None; - s_packageManagerEventCallback = new Interop.PackageManager.PackageManagerEventCallback(InternalEventCallback); if (!Handle.IsInvalid) { @@ -1230,8 +1229,6 @@ namespace Tizen.Applications return; } - s_packageManagerEventCallback = null; - lock (Handle) { var err = Interop.PackageManager.PackageManagerUnsetEvent(Handle); -- 2.7.4