[NUI] Fix more CA2000 warnings in NUI.
authorhuayong.xu <huayong.xu@samsung.com>
Mon, 7 Apr 2025 08:41:02 +0000 (16:41 +0800)
committerSangHyeon Jade Lee <dltkdgus1764@gmail.com>
Thu, 17 Apr 2025 07:55:55 +0000 (16:55 +0900)
After this patch, about 87 CA2000 warnings are remaining in VS.

21 files changed:
src/Tizen.NUI/src/deprecated/BaseComponents/View_Deprecated.cs
src/Tizen.NUI/src/devel/Lite/UIShadow.cs
src/Tizen.NUI/src/internal/Application/Application.cs
src/Tizen.NUI/src/internal/Common/VisualObjectsContainer.cs
src/Tizen.NUI/src/internal/Transition/TransitionGroupItem.cs
src/Tizen.NUI/src/public/Application/NUIWidgetComponent.cs
src/Tizen.NUI/src/public/BaseComponents/ImageView.cs
src/Tizen.NUI/src/public/BaseComponents/LottieAnimationView.cs
src/Tizen.NUI/src/public/BaseComponents/View.cs
src/Tizen.NUI/src/public/BaseComponents/ViewBindableProperty.cs
src/Tizen.NUI/src/public/BaseComponents/ViewPublicMethods.cs
src/Tizen.NUI/src/public/Common/TypeRegistry.cs
src/Tizen.NUI/src/public/ParticleSystem/ParticleEmitter.cs
src/Tizen.NUI/src/public/Utility/Capture.cs
src/Tizen.NUI/src/public/Visuals/AnimatedImageVisual.cs
src/Tizen.NUI/src/public/Visuals/VisualFactory.cs
src/Tizen.NUI/src/public/Visuals/VisualObject/AnimatedImageVisual.cs
src/Tizen.NUI/src/public/Visuals/VisualObject/BorderVisual.cs
src/Tizen.NUI/src/public/Visuals/VisualObject/VisualBase.cs
src/Tizen.NUI/src/public/Window/Window.cs
src/Tizen.NUI/src/public/Window/WindowEvent.cs

index 542ed362519d36c5f5a905def1057ffba67710cd..acf8543af93b6e3a01d059c093e48fd57258196c 100644 (file)
@@ -70,13 +70,14 @@ namespace Tizen.NUI.BaseComponents
             if (ret != null)
             {
                 Interop.BaseHandle.DeleteBaseHandle(new HandleRef(this, cPtr));
+                NDalicPINVOKE.ThrowExceptionIfExists();
+                return ret;
             }
             else
             {
                 ret = new Renderer(cPtr, true);
+                return ret;
             }
-            NDalicPINVOKE.ThrowExceptionIfExists();
-            return ret;
         }
 
         /// <summary>
index 53640ee5d14033eb6349a25f71fb52f19f2dc123..0f27c2bd7d3f2bc3e735b2c4f2e0409774b8ac32 100644 (file)
@@ -211,7 +211,13 @@ namespace Tizen.NUI
             return !operand1.Equals(operand2);
         }
 
-        internal readonly NUI.Shadow ToShadow() => new NUI.Shadow(BlurRadius, Color.ToReferenceType(), new (OffsetX, OffsetY), new (ExtraWidth, ExtraHeight));
+        internal readonly NUI.Shadow ToShadow()
+        {
+            using var color = Color.ToReferenceType();
+            using Vector2 offset = new(OffsetX, OffsetY);
+            using Vector2 extents = new(ExtraWidth, ExtraHeight);
+            return new NUI.Shadow(BlurRadius, color, offset, extents);
+        }
 
         internal readonly PropertyMap BuildMap(View attachedView)
         {
index 66cda0d1a9aef0a69637d9041ff0fb9e17cb5f45..9ea05af3d27ae6581cb29ac7a53a120c406bea4b 100755 (executable)
@@ -1944,10 +1944,9 @@ namespace Tizen.NUI
             }
 
             // It will be removed until dali APIs are prepared.
-            Rectangle initRectangle = new Rectangle(0, 0, 0, 0);
+            using Rectangle initRectangle = new Rectangle(0, 0, 0, 0);
 
             Application ret = new Application(Interop.Application.New(argc, argvStr, stylesheet, (int)windowMode, Rectangle.getCPtr(initRectangle), (int)type), true);
-            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
 
index 2d1a31eeb7984ce1b9015e4f5955297b5bbd0dd6..901517cfdd8e4f9bd0e74240e780c7505e2d4fe3 100644 (file)
@@ -63,27 +63,29 @@ namespace Tizen.NUI.Visuals
         public Tizen.NUI.BaseComponents.View GetView()
         {
             global::System.IntPtr cPtr = Interop.VisualObjectsContainer.GetOwner(SwigCPtr);
-            
-            Tizen.NUI.BaseComponents.View ret = null;
+
             if (Interop.RefObject.GetRefObjectPtr(cPtr) == global::System.IntPtr.Zero)
             {
                 // Visual container don't have owner. Return null.
                 Interop.BaseHandle.DeleteBaseHandle(new global::System.Runtime.InteropServices.HandleRef(this, cPtr));
+                NDalicPINVOKE.ThrowExceptionIfExists();
             }
             else
             {
-                ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Tizen.NUI.BaseComponents.View;
+                Tizen.NUI.BaseComponents.View ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Tizen.NUI.BaseComponents.View;
                 if (ret != null)
                 {
                     Interop.BaseHandle.DeleteBaseHandle(new global::System.Runtime.InteropServices.HandleRef(this, cPtr));
+                    NDalicPINVOKE.ThrowExceptionIfExists();
+                    return ret;
                 }
                 else
                 {
                     ret = new Tizen.NUI.BaseComponents.View(cPtr, true);
+                    return ret;
                 }
             }
-            NDalicPINVOKE.ThrowExceptionIfExists();
-            return ret;
+            return null;
         }
 
         public int GetContainerRangeType()
index fefa1275fc55ac5f50c09068ddcf97e537a2449f..bb4c8792788309919dee9e67615423988b03e828 100644 (file)
@@ -53,7 +53,7 @@ namespace Tizen.NUI
             transitionItemList = new List<TransitionItemBase>();
             for (int index = 0; index < transitionList.Count; ++index)
             {
-                TimePeriod localTimePeriod = new TimePeriod(transitionList[index].GetTimePeriod().DelayMilliseconds, transitionList[index].GetTimePeriod().DurationMilliseconds);
+                using TimePeriod localTimePeriod = new TimePeriod(transitionList[index].GetTimePeriod().DelayMilliseconds, transitionList[index].GetTimePeriod().DurationMilliseconds);
                 AlphaFunction localAlphaFunction = transitionList[index].GetAlphaFunction();
                 if (useGroupTimePeriod)
                 {
index 844dc99a009edaa7216a7eb0e56168b777e3810b..a26be15b577aec379e5b3f8fa31644c258427c4d 100755 (executable)
@@ -57,8 +57,8 @@ namespace Tizen.NUI
                     instance.GetWindow().Hide();
                     defaultWindowSet = true;
                 }
-
-                Window = new Window(new Rectangle(0, 0, width, height), false);
+                using var rect = new Rectangle(0, 0, width, height);
+                Window = new Window(rect, false);
                 Window.Show();
             }
             NUIWindowProxy = new NUIWindowProxy(Window);
index 5b95edad183534bcd2a4639d099ad8a02674770f..baeb2fbc593a32620b6080b12c19bee956e77e7d 100755 (executable)
@@ -2351,7 +2351,8 @@ namespace Tizen.NUI.BaseComponents
             if (_border != value)
             {
                 _border = new Rectangle(value);
-                UpdateImage(NpatchImageVisualProperty.Border, new PropertyValue(_border));
+                using var pv = new PropertyValue(_border);
+                UpdateImage(NpatchImageVisualProperty.Border, pv);
             }
         }
 
index 1e8fd489a866d499d67149f26cd111a746ea7088..e84f7a64faa39c6f63801926817a2431ade72ab1 100755 (executable)
@@ -1167,14 +1167,22 @@ namespace Tizen.NUI.BaseComponents
             // Update currentStates properties to cachedImagePropertyMap
             if (currentStates.changed)
             {
-                UpdateImage(ImageVisualProperty.LoopCount, new PropertyValue(currentStates.loopCount), false);
-                UpdateImage(ImageVisualProperty.StopBehavior, new PropertyValue((int)currentStates.stopEndAction), false);
-                UpdateImage(ImageVisualProperty.LoopingMode, new PropertyValue((int)currentStates.loopMode), false);
-                UpdateImage(ImageVisualProperty.RedrawInScalingDown, new PropertyValue(currentStates.redrawInScalingDown), false);
-                UpdateImage(ImageVisualProperty.SynchronousLoading, new PropertyValue(currentStates.synchronousLoading), false);
-                UpdateImage(ImageVisualProperty.EnableFrameCache, new PropertyValue(currentStates.enableFrameCache), false);
-                UpdateImage(ImageVisualProperty.NotifyAfterRasterization, new PropertyValue(currentStates.notifyAfterRasterization), false);
-                UpdateImage(ImageVisualProperty.FrameSpeedFactor, new PropertyValue(currentStates.frameSpeedFactor), false);
+                using (var pv = new PropertyValue(currentStates.loopCount))
+                    UpdateImage(ImageVisualProperty.LoopCount, pv, false);
+                using (var pv = new PropertyValue((int)currentStates.stopEndAction))
+                    UpdateImage(ImageVisualProperty.StopBehavior, pv, false);
+                using (var pv = new PropertyValue((int)currentStates.loopMode))
+                    UpdateImage(ImageVisualProperty.LoopingMode, pv, false);
+                using (var pv = new PropertyValue(currentStates.redrawInScalingDown))
+                    UpdateImage(ImageVisualProperty.RedrawInScalingDown, pv, false);
+                using (var pv = new PropertyValue(currentStates.synchronousLoading))
+                    UpdateImage(ImageVisualProperty.SynchronousLoading, pv, false);
+                using (var pv = new PropertyValue(currentStates.enableFrameCache))
+                    UpdateImage(ImageVisualProperty.EnableFrameCache, pv, false);
+                using (var pv = new PropertyValue(currentStates.notifyAfterRasterization))
+                    UpdateImage(ImageVisualProperty.NotifyAfterRasterization, pv, false);
+                using (var pv = new PropertyValue(currentStates.frameSpeedFactor))
+                    UpdateImage(ImageVisualProperty.FrameSpeedFactor, pv, false);
 
                 // Do not cache PlayRange and TotalFrameNumber into cachedImagePropertyMap.
                 // (To keep legacy implements behaviour)
index aee02eaf1950693efb38d74ecd2beb0765665a8e..e085e306cc65cbc31d3fd340d7434bbf7c487712 100755 (executable)
@@ -5418,17 +5418,21 @@ namespace Tizen.NUI.BaseComponents
                 {
                     ret = new View(Layer.getCPtr(layer).Handle, false);
                     NUILog.Error("This Parent property is deprecated, should do not be used");
+                    Interop.BaseHandle.DeleteBaseHandle(CPtr);
+                    CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
+
+                    if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
+                    return ret;
                 }
                 else
                 {
                     ret = basehandle as View;
-                }
-
-                Interop.BaseHandle.DeleteBaseHandle(CPtr);
-                CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
+                    Interop.BaseHandle.DeleteBaseHandle(CPtr);
+                    CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
 
-                if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
-                return ret;
+                    if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
+                    return ret;
+                }
             }
         }
 
index 278f956a5f504ff2e51fc5be34d3ebd5191b0953..18f685ceaeeecb4fb9fb87a5a9d6814c38e04566 100755 (executable)
@@ -2251,7 +2251,10 @@ namespace Tizen.NUI.BaseComponents
 
             int visualType = 0;
 
-            map.Find(Visual.Property.Type)?.Get(out visualType);
+            using (var pv = map.Find(Visual.Property.Type))
+            {
+                pv?.Get(out visualType);
+            }
 
             if (visualType == (int)Visual.Type.Image)
             {
@@ -2261,7 +2264,10 @@ namespace Tizen.NUI.BaseComponents
             // Background extra data flag is not meanful anymore.
             backgroundExtraDataUpdatedFlag &= ~BackgroundExtraDataUpdatedFlag.Background;
 
-            Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)SwigCPtr, View.Property.BACKGROUND, new PropertyValue(map));
+            using (var pv = new PropertyValue(map))
+            {
+                Tizen.NUI.Object.SetProperty(SwigCPtr, View.Property.BACKGROUND, pv);
+            }
         }
 
         private void SetBorderlineColor(Color value)
@@ -2302,9 +2308,8 @@ namespace Tizen.NUI.BaseComponents
 
             backgroundExtraDataUpdatedFlag &= ~BackgroundExtraDataUpdatedFlag.Background;
 
-            var mapValue = new PropertyValue(map);
+            using var mapValue = new PropertyValue(map);
             Object.SetProperty(SwigCPtr, Property.BACKGROUND, mapValue);
-
         }
 
         private void SetColor(Color value)
@@ -2367,7 +2372,8 @@ namespace Tizen.NUI.BaseComponents
 
         private void SetShadow(ShadowBase value)
         {
-            Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)SwigCPtr, View.Property.SHADOW, value == null ? new PropertyValue() : value.ToPropertyValue(this));
+            using var pv = value == null ? new PropertyValue() : value.ToPropertyValue(this);
+            Tizen.NUI.Object.SetProperty(SwigCPtr, View.Property.SHADOW, pv);
         }
     }
 }
index 8a870c026c844ec22b0339f812fba3fd6af66286..002226cfeda2316cf3fed4fa0ccf5f278535d1b9 100755 (executable)
@@ -499,6 +499,7 @@ namespace Tizen.NUI.BaseComponents
             {
                 // Register new camera into Registry.
                 ret = new Animatable(cPtr, true);
+                return ret;
             }
             else
             {
@@ -506,9 +507,9 @@ namespace Tizen.NUI.BaseComponents
                 HandleRef handle = new HandleRef(this, cPtr);
                 Interop.Actor.DeleteActor(handle);
                 handle = new HandleRef(null, IntPtr.Zero);
+                if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+                return ret;
             }
-            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-            return ret;
         }
 
         /// <summary>
@@ -647,13 +648,14 @@ namespace Tizen.NUI.BaseComponents
             if (ret != null)
             {
                 Interop.BaseHandle.DeleteBaseHandle(new HandleRef(this, cPtr));
+                NDalicPINVOKE.ThrowExceptionIfExists();
+                return ret;
             }
             else
             {
                 ret = new Renderable(cPtr, true);
+                return ret;
             }
-            NDalicPINVOKE.ThrowExceptionIfExists();
-            return ret;
         }
 
         /// <summary>
index 8c40acb2f2efb13fd2132834a65b95f4f6b56983..8f5ef1ad5dad0ecdcaf685a87b4baae9e6f2c19a 100755 (executable)
@@ -85,14 +85,14 @@ namespace Tizen.NUI
                 global::System.Runtime.InteropServices.HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(dummyObect, cPtr);
                 Interop.BaseHandle.DeleteBaseHandle(CPtr);
                 CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
+                if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+                return ret;
             }
             else
             {
                 ret = new TypeRegistry(cPtr, true);
+                return ret;
             }
-
-            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-            return ret;
         }
 
         [EditorBrowsable(EditorBrowsableState.Never)]
@@ -147,14 +147,14 @@ namespace Tizen.NUI
                 global::System.Runtime.InteropServices.HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
                 Interop.BaseHandle.DeleteBaseHandle(CPtr);
                 CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
+                if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+                return ret;
             }
             else
             {
                 ret = new Tizen.NUI.TypeInfo(cPtr, true);
+                return ret;
             }
-
-            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-            return ret;
         }
 
         internal Tizen.NUI.TypeInfo GetTypeInfo(SWIGTYPE_p_std__type_info registerType)
index 6dbe0b47d49789461f93b88b1a5505a6d64a3d2f..5be844e00658d4e87ec5674f221951e180e9d469 100644 (file)
@@ -223,12 +223,13 @@ namespace Tizen.NUI.ParticleSystem
         {
             set
             {
-                var pixelBuffer = ImageLoader.LoadImageFromFile(value);
+                using var pixelBuffer = ImageLoader.LoadImageFromFile(value);
                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
 
-                Texture tex = new Texture(TextureType.TEXTURE_2D, PixelFormat.RGBA8888, pixelBuffer.GetWidth(),
+                using Texture tex = new Texture(TextureType.TEXTURE_2D, PixelFormat.RGBA8888, pixelBuffer.GetWidth(),
                         pixelBuffer.GetHeight());
-                tex.Upload(pixelBuffer.CreatePixelData());
+                using var pd = pixelBuffer.CreatePixelData();
+                tex.Upload(pd);
 
                 Interop.ParticleEmitter.SetTexture(SwigCPtr, tex.SwigCPtr);
                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
index d74d7a71b8f824ee99f22d9ae6ac98e1c419f1ef..e618ac649ab773b858bb666bde422a8f288fed08 100755 (executable)
@@ -152,7 +152,9 @@ namespace Tizen.NUI
 
             if (source is View || source is Layer)
             {
-                Interop.Capture.Start4(SwigCPtr, source.SwigCPtr, new Vector2(position.X, position.Y).SwigCPtr, new Vector2(size.Width, size.Height).SwigCPtr, path, new Vector4(color.R, color.G, color.B, color.A).SwigCPtr);
+                using var posVector2 = new Vector2(position.X, position.Y);
+                using var sizeVector2 = new Vector2(size.Width, size.Height);
+                Interop.Capture.Start4(SwigCPtr, source.SwigCPtr, posVector2.SwigCPtr, sizeVector2.SwigCPtr, path, new Vector4(color.R, color.G, color.B, color.A).SwigCPtr);
 
                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             }
@@ -196,7 +198,8 @@ namespace Tizen.NUI
 
             if (source is View || source is Layer)
             {
-                Interop.Capture.Start3(SwigCPtr, source.SwigCPtr, new Vector2(size.Width, size.Height).SwigCPtr, path, new Vector4(color.R, color.G, color.B, color.A).SwigCPtr, quality);
+                using var sizeVector2 = new Vector2(size.Width, size.Height);
+                Interop.Capture.Start3(SwigCPtr, source.SwigCPtr, sizeVector2.SwigCPtr, path, new Vector4(color.R, color.G, color.B, color.A).SwigCPtr, quality);
 
                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             }
@@ -235,7 +238,8 @@ namespace Tizen.NUI
 
             if (source is View || source is Layer)
             {
-                Interop.Capture.Start1(SwigCPtr, source.SwigCPtr, new Vector2(size.Width, size.Height).SwigCPtr, path, new Vector4(color.R, color.G, color.B, color.A).SwigCPtr);
+                using var sizeVector2 = new Vector2(size.Width, size.Height);
+                Interop.Capture.Start1(SwigCPtr, source.SwigCPtr, sizeVector2.SwigCPtr, path, new Vector4(color.R, color.G, color.B, color.A).SwigCPtr);
 
                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             }
@@ -272,7 +276,8 @@ namespace Tizen.NUI
 
             if (source is View || source is Layer)
             {
-                Interop.Capture.Start2(SwigCPtr, source.SwigCPtr, new Vector2(size.Width, size.Height).SwigCPtr, path);
+                using var sizeVector2 = new Vector2(size.Width, size.Height);
+                Interop.Capture.Start2(SwigCPtr, source.SwigCPtr, sizeVector2.SwigCPtr, path);
 
                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             }
@@ -357,13 +362,14 @@ namespace Tizen.NUI
             if (ret != null)
             {
                 Interop.BaseHandle.DeleteBaseHandle(new HandleRef(this, cPtr));
+                NDalicPINVOKE.ThrowExceptionIfExists();
+                return ret;
             }
             else
             {
                 ret = new ImageUrl(cPtr, true);
+                return ret;
             }
-            NDalicPINVOKE.ThrowExceptionIfExists();
-            return ret;
         }
 
         /// <summary>
index 12fe5c748259b17a4eb642baf3ff5a8f51348ecf..8182f619499d2b6005e179b83789f1c26d22980c 100755 (executable)
@@ -173,16 +173,16 @@ namespace Tizen.NUI
                 }
                 else
                 {
-                    var urlArray = new PropertyArray();
+                    using var urlArray = new PropertyArray();
                     foreach (var url in urls)
                     {
-                        urlArray.Add(new PropertyValue(url));
+                        var pv = new PropertyValue(url);
+                        using var _ = urlArray.Add(pv);
                     }
                     using (var temp = new PropertyValue(urlArray))
                     {
                         _outputVisualMap.Add(ImageVisualProperty.URL, temp);
                     }
-                    urlArray.Dispose();
                 }
                 if (batchSize != null)
                 {
index 0ca06449da4deb2cd4b4fd6ad577f5bb341280e4..23b3697a2c4d2b45282c11216454f3609514217b 100755 (executable)
@@ -84,14 +84,14 @@ namespace Tizen.NUI
                 global::System.Runtime.InteropServices.HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(dummyObect, cPtr);
                 Interop.BaseHandle.DeleteBaseHandle(CPtr);
                 CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
+                if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+                return ret;
             }
             else
             {
                 ret = new VisualFactory(cPtr, true);
+                return ret;
             }
-
-            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-            return ret;
         }
 
         [EditorBrowsable(EditorBrowsableState.Never)]
index ee1dda044b22fad3dbe81a5e330f83126bbe91b2..fd1ceb0898be0e790bba10be575f606abe670dd2 100644 (file)
@@ -296,8 +296,8 @@ namespace Tizen.NUI.Visuals
                 using var urlArray = new PropertyArray();
                 foreach (var url in resourceUrls)
                 {
-                    using var urlValue = new PropertyValue(url);
-                    urlArray.Add(urlValue);
+                    var urlValue = new PropertyValue(url);
+                    using var _ = urlArray.Add(urlValue);
                 }
 
                 if (cachedVisualPropertyMap != null)
index 2d18cb799205bb4e86aa795d828fe87e8855061c..f858b30b9626e31dec599107d5af66d0a5589352 100644 (file)
@@ -60,8 +60,10 @@ namespace Tizen.NUI.Visuals
             get
             {
                 Tizen.NUI.Color ret = new Tizen.NUI.Color();
-                using var propertyValue = GetCachedVisualProperty((int)Tizen.NUI.BorderVisualProperty.Color);
-                propertyValue?.Get(ret);
+                using (var propertyValue = GetCachedVisualProperty((int)Tizen.NUI.BorderVisualProperty.Color))
+                {
+                    propertyValue?.Get(ret);
+                }
                 return ret;
             }
         }
index c1591efacf61915cfb572a5404fdb4865f40edf8..3e5e3b1e508dff384a93a842086fcbd391e16e61 100644 (file)
@@ -904,7 +904,8 @@ namespace Tizen.NUI.Visuals
 
                 // Get type from the property map.
                 internalType = (int)Tizen.NUI.Visual.Type.Invalid;
-                if (cachedVisualPropertyMap?.Find((int)Tizen.NUI.Visual.Property.Type)?.Get(out internalType) ?? false)
+                using var pv = cachedVisualPropertyMap?.Find((int)Tizen.NUI.Visual.Property.Type);
+                if (pv?.Get(out internalType) ?? false)
                 {
                     UpdateVisualPropertyMap();
                 }
index f23983e5d341e45c9184a630f9f2ee54a969c7ca..26e198e155744372cebb33436cc29751b2352212 100755 (executable)
@@ -1362,6 +1362,7 @@ namespace Tizen.NUI
             }
             Interop.Window.FeedHoverEvent(SwigCPtr, TouchPoint.getCPtr(touchPoint));
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            touchPoint.Dispose();
         }
 
         /// <summary>
@@ -1645,14 +1646,14 @@ namespace Tizen.NUI
                 HandleRef CPtr = new HandleRef(this, cPtr);
                 Interop.BaseHandle.DeleteBaseHandle(CPtr);
                 CPtr = new HandleRef(null, global::System.IntPtr.Zero);
+                if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+                return ret;
             }
             else
             {
                 ret = new RenderTaskList(cPtr, true);
+                return ret;
             }
-
-            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-            return ret;
         }
 
         /// <summary>
index a6184995cbb19ac647b4a5758088d452c0cc1a9c..60ca5896ea627ea955e60da5a0464fadf29756f2 100755 (executable)
@@ -1939,7 +1939,10 @@ namespace Tizen.NUI
             for (int i = 0; i < size; i++)
             {
                 string option = "none";
-                tmp.GetElementAt((uint)i).Get(out option);
+                using (var pv = tmp.GetElementAt((uint)i))
+                {
+                    pv.Get(out option);
+                }
                 tmpList.Add(option);
             }