[NUI] Fix CA2000 warning for Window
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / Window.cs
index c586e6e..36cc3a3 100755 (executable)
@@ -423,6 +423,7 @@ namespace Tizen.NUI
                 Position2D position = GetPosition();
                 Size2D size = GetSize();
                 Rectangle ret = new Rectangle(position.X, position.Y, size.Width, size.Height);
+                position.Dispose();
                 return ret;
             }
             set
@@ -1165,11 +1166,14 @@ namespace Tizen.NUI
             {
                 for (int i = 0; i < orientations.Count; i++)
                 {
-                    orientationArray.PushBack(new PropertyValue((int)orientations[i]));
+                    PropertyValue value = new PropertyValue((int)orientations[i]);
+                    orientationArray.PushBack(value);
+                    value.Dispose();
                 }
             }
 
             Interop.Window.SetAvailableOrientations(SwigCPtr, PropertyArray.getCPtr(orientationArray));
+            orientationArray.Dispose();
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
@@ -1222,6 +1226,7 @@ namespace Tizen.NUI
         {
             var val = new Uint16Pair(Interop.Window.GetSize(SwigCPtr), false);
             Vector2 ret = new Vector2(val.GetWidth(), val.GetHeight());
+            val.Dispose();
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
@@ -1309,9 +1314,8 @@ namespace Tizen.NUI
             }
             var val = new Uint16Pair((uint)size.Width, (uint)size.Height);
             Interop.Window.SetSize(SwigCPtr, Uint16Pair.getCPtr(val));
-
+            val.Dispose();
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-
             // Resetting Window size should request a relayout of the tree.
         }
 
@@ -1319,7 +1323,7 @@ namespace Tizen.NUI
         {
             var val = new Uint16Pair(Interop.Window.GetSize(SwigCPtr), false);
             Size2D ret = new Size2D(val.GetWidth(), val.GetHeight());
-
+            val.Dispose();
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
@@ -1332,7 +1336,7 @@ namespace Tizen.NUI
             }
             var val = new Uint16Pair((uint)position.X, (uint)position.Y);
             Interop.Window.SetPosition(SwigCPtr, Uint16Pair.getCPtr(val));
-
+            val.Dispose();
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             // Setting Position of the window should request a relayout of the tree.
         }
@@ -1341,7 +1345,7 @@ namespace Tizen.NUI
         {
             var val = new Uint16Pair(Interop.Window.GetPosition(SwigCPtr), true);
             Position2D ret = new Position2D(val.GetX(), val.GetY());
-
+            val.Dispose();
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }