Fix some SVACE issues.
authorzhouhao02 <haozhou.zhou@samsung.com>
Mon, 21 Aug 2023 09:43:59 +0000 (17:43 +0800)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Tue, 29 Aug 2023 09:52:04 +0000 (18:52 +0900)
src/Tizen.NUI/src/internal/Common/DebugFileLogging.cs
src/Tizen.NUI/src/public/BaseComponents/ViewEvent.cs
src/Tizen.NUI/src/public/Common/BaseHandle.cs

index 25a29d1..77f6cb5 100755 (executable)
@@ -49,7 +49,8 @@ namespace Tizen.NUI
 
             Directory.CreateDirectory(logFolderPath);
 
-            var id = Process.GetCurrentProcess().Id;
+            using var process = Process.GetCurrentProcess();
+            var id = process.Id;
             filePath = logFolderPath + id.ToString();
             file = new FileStream(filePath, FileMode.OpenOrCreate, FileAccess.ReadWrite);
         }
index 86d44f0..cf4892c 100755 (executable)
@@ -705,13 +705,14 @@ namespace Tizen.NUI.BaseComponents
                 {
                     if (keyInputFocusGainedEventHandler != null)
                     {
-                        var process = global::System.Diagnostics.Process.GetCurrentProcess().Id;
+                        using var process = global::System.Diagnostics.Process.GetCurrentProcess();
+                        var processId = process.Id;
                         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" +
-                            $" process:{process} thread:{thread}, isDisposed:{this.Disposed}, isDisposeQueued:{this.IsDisposeQueued}, me:{me}\n");
+                            $" process:{processId} thread:{thread}, isDisposed:{this.Disposed}, isDisposeQueued:{this.IsDisposeQueued}, me:{me}\n");
                     }
                 }
                 else
index 4abc71c..cca7f46 100755 (executable)
@@ -336,15 +336,16 @@ namespace Tizen.NUI
                 //Throw exception if Dispose() is called in separate thread.
                 if (!Window.IsInstalled())
                 {
-                    var process = global::System.Diagnostics.Process.GetCurrentProcess().Id;
+                    using var process = global::System.Diagnostics.Process.GetCurrentProcess();
+                    var processId = process.Id;
                     var thread = global::System.Threading.Thread.CurrentThread.ManagedThreadId;
                     var me = this.GetType().FullName;
 
                     DebugFileLogging.Instance.WriteLog("[NUI][BaseHandle] This API called from separate thread. This API must be called from MainThread. \n" +
-                        $" process:{process} thread:{thread}, disposing:{disposing}, isDisposed:{this.disposed}, isDisposeQueued:{this.isDisposeQueued}, me:{me}\n");
+                        $" process:{processId} thread:{thread}, disposing:{disposing}, isDisposed:{this.disposed}, isDisposeQueued:{this.isDisposeQueued}, me:{me}\n");
 
                     Tizen.Log.Fatal("NUI", $"[NUI][BaseHandle] This API called from separate thread. This API must be called from MainThread. \n" +
-                        $" process:{process} thread:{thread}, disposing:{disposing}, isDisposed:{this.disposed}, isDisposeQueued:{this.isDisposeQueued}, me:{me}\n");
+                        $" process:{processId} thread:{thread}, disposing:{disposing}, isDisposed:{this.disposed}, isDisposeQueued:{this.isDisposeQueued}, me:{me}\n");
 
                     //to fix ArtApp black screen issue. this will be enabled after talking with ArtApp team and fixing it.
                     // throw new global::System.InvalidOperationException("[NUI][BaseHandle] This API called from separate thread. This API must be called from MainThread. \n" +
@@ -602,13 +603,14 @@ namespace Tizen.NUI
             {
                 if (swigCPtr.Handle == IntPtr.Zero)
                 {
-                    var process = global::System.Diagnostics.Process.GetCurrentProcess().Id;
+                    using var process = global::System.Diagnostics.Process.GetCurrentProcess();
+                    var processId = process.Id;
                     var thread = global::System.Threading.Thread.CurrentThread.ManagedThreadId;
                     var me = this.GetType().FullName;
 
                     Tizen.Log.Fatal("NUI", $"SwigCPtr 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");
+                        $" process:{processId} thread:{thread}, isDisposed:{this.disposed}, isDisposeQueued:{this.isDisposeQueued}, me:{me}\n");
 
                     Tizen.Log.Fatal("NUI", $"[ERROR] back trace!");
                     global::System.Diagnostics.StackTrace st = new global::System.Diagnostics.StackTrace(true);