[NFC][Non-ACR] Fix NFC Csharp TC failed issue (#1848)
authorjh8801jung <jh8801.jung@samsung.com>
Wed, 22 Jul 2020 00:25:39 +0000 (09:25 +0900)
committerGitHub <noreply@github.com>
Wed, 22 Jul 2020 00:25:39 +0000 (09:25 +0900)
- https://code.sec.samsung.net/jira/browse/TFDF-10927

Signed-off-by: Jihoon Jung <jh8801.jung@samsung.com>
src/Tizen.Network.Nfc/Tizen.Network.Nfc/NfcTag.cs

index 8e7c8c6..a6f193b 100644 (file)
@@ -45,6 +45,9 @@ namespace Tizen.Network.Nfc
         /// </summary>
         public NfcTag()
         {
+            // A method is need to convert delegate to pass unmanaged layer through Interop call
+            // If we do not convert explicitly it, implicitly convert was occurred
+            // and temporal delegate was created. and it could be released by GC
             _nativeTransceiveCallback = TransceiveCompletedCallback;
             _nativeVoidCallback = VoidCallback;
             _nativeTagReadCallback = ReadNdefCallback;
@@ -126,6 +129,9 @@ namespace Tizen.Network.Nfc
         internal NfcTag(IntPtr handle)
         {
             _tagHandle = handle;
+            _nativeTransceiveCallback = TransceiveCompletedCallback;
+            _nativeVoidCallback = VoidCallback;
+            _nativeTagReadCallback = ReadNdefCallback;
         }
 
         /// <summary>