[NUI] Fix PropertyNotification & PanGestureDetector svace issues
authorXianbing Teng <xb.teng@samsung.com>
Wed, 18 Jan 2023 07:53:31 +0000 (15:53 +0800)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Thu, 2 Feb 2023 06:58:07 +0000 (15:58 +0900)
src/Tizen.NUI/src/public/Common/PropertyNotification.cs
src/Tizen.NUI/src/public/Events/PanGestureDetector.cs

index c879662..c380290 100755 (executable)
@@ -281,14 +281,13 @@ namespace Tizen.NUI
         {
             if (IsNativeHandleInvalid())
             {
+                var process = global::System.Diagnostics.Process.GetCurrentProcess()?.Id ?? -1;
+                var thread = global::System.Threading.Thread.CurrentThread.ManagedThreadId;
+                var me = this.GetType().FullName;
                 if (this.Disposed)
                 {
                     if (propertyNotificationNotifyEventHandler != null)
                     {
-                        var process = global::System.Diagnostics.Process.GetCurrentProcess().Id;
-                        var thread = global::System.Threading.Thread.CurrentThread.ManagedThreadId;
-                        var me = this.GetType().FullName;
-
                         Tizen.Log.Error("NUI", $"Error! NUI's native dali object is already disposed. " +
                             $"OR the native dali object handle of NUI becomes null! \n" +
                             $" process:{process} thread:{thread}, isDisposed:{this.Disposed}, isDisposeQueued:{this.IsDisposeQueued}, me:{me}\n");
@@ -298,10 +297,6 @@ namespace Tizen.NUI
                 {
                     if (this.IsDisposeQueued)
                     {
-                        var process = global::System.Diagnostics.Process.GetCurrentProcess().Id;
-                        var thread = global::System.Threading.Thread.CurrentThread.ManagedThreadId;
-                        var me = this.GetType().FullName;
-
                         //in this case, this object is ready to be disposed waiting on DisposeQueue, so event callback should not be invoked!
                         Tizen.Log.Error("NUI", "in this case, the View object is ready to be disposed waiting on DisposeQueue, so event callback should not be invoked! just return here! \n" +
                             $"process:{process} thread:{thread}, isDisposed:{this.Disposed}, isDisposeQueued:{this.IsDisposeQueued}, me:{me}\n");
index f705010..033dac7 100755 (executable)
@@ -589,14 +589,13 @@ namespace Tizen.NUI
         {
             if (IsNativeHandleInvalid())
             {
+                var process = global::System.Diagnostics.Process.GetCurrentProcess()?.Id ?? -1;
+                var thread = global::System.Threading.Thread.CurrentThread.ManagedThreadId;
+                var me = this.GetType().FullName;
                 if (this.Disposed)
                 {
                     if (detectedEventHandler != null)
                     {
-                        var process = global::System.Diagnostics.Process.GetCurrentProcess().Id;
-                        var thread = global::System.Threading.Thread.CurrentThread.ManagedThreadId;
-                        var me = this.GetType().FullName;
-
                         Tizen.Log.Error("NUI", $"Error! NUI's native dali object is already disposed. " +
                             $"OR the native dali object handle of NUI becomes null! \n" +
                             $" process:{process} thread:{thread}, isDisposed:{this.Disposed}, isDisposeQueued:{this.IsDisposeQueued}, me:{me}\n");
@@ -606,10 +605,6 @@ namespace Tizen.NUI
                 {
                     if (this.IsDisposeQueued)
                     {
-                        var process = global::System.Diagnostics.Process.GetCurrentProcess().Id;
-                        var thread = global::System.Threading.Thread.CurrentThread.ManagedThreadId;
-                        var me = this.GetType().FullName;
-
                         //in this case, this object is ready to be disposed waiting on DisposeQueue, so event callback should not be invoked!
                         Tizen.Log.Error("NUI", "in this case, the View object is ready to be disposed waiting on DisposeQueue, so event callback should not be invoked! just return here! \n" +
                             $"process:{process} thread:{thread}, isDisposed:{this.Disposed}, isDisposeQueued:{this.IsDisposeQueued}, me:{me}\n");