[NUI] Add some debugging code to check if the object,which has no body, is used
authordongsug.song <dongsug.song@samsung.com>
Thu, 18 Nov 2021 04:03:57 +0000 (13:03 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Thu, 18 Nov 2021 04:08:28 +0000 (13:08 +0900)
src/Tizen.NUI/src/public/BaseComponents/ViewInternal.cs
src/Tizen.NUI/src/public/Common/BaseHandle.cs

index 04342e1..252d9f1 100755 (executable)
@@ -424,6 +424,22 @@ namespace Tizen.NUI.BaseComponents
         internal uint GetId()
         {
             uint ret = Interop.Actor.GetId(SwigCPtr);
+
+            //this is temporary debugging code. will be removed in 2 weeks
+            {
+                int minusOne = -1;
+                uint errorRet = (uint)minusOne;
+                if (ret == errorRet || SwigCPtr.Handle == IntPtr.Zero)
+                {
+                    var process = global::System.Diagnostics.Process.GetCurrentProcess().Id;
+                    var thread = global::System.Threading.Thread.CurrentThread.ManagedThreadId;
+                    var me = this.GetType().FullName;
+
+                    Log.Fatal("NUI", $"Error! GetId error OR swigCPtr.Handle == IntPtr.Zero ! please check! \n" +
+                        $" process:{process} thread:{thread}, isDisposed:{this.Disposed}, isDisposeQueued:{this.IsDisposeQueued}, me:{me}\n");
+                }
+            }
+
             if (NDalicPINVOKE.SWIGPendingException.Pending)
                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
index 2a4ef7b..904d0a5 100644 (file)
@@ -620,8 +620,7 @@ namespace Tizen.NUI
                     var thread = global::System.Threading.Thread.CurrentThread.ManagedThreadId;
                     var me = this.GetType().FullName;
 
-                    throw new ObjectDisposedException(nameof(SwigCPtr), $"Error! NUI's native dali object is already disposed. " +
-                        $"OR the native dali object handle of NUI becomes null! \n" +
+                    Log.Fatal("NUI", $"Error! swigCPtr.Handle == IntPtr.Zero ! please check! \n" +
                         $" process:{process} thread:{thread}, isDisposed:{this.disposed}, isDisposeQueued:{this.isDisposeQueued}, me:{me}\n");
                 }
                 return swigCPtr;