[NUI] Fix CA2000 issues in Model3dView and RenderTask.
authorguowei.wang <guowei.wang@samsung.com>
Fri, 25 Dec 2020 06:03:03 +0000 (14:03 +0800)
committerhuiyueun <35286162+huiyueun@users.noreply.github.com>
Mon, 11 Jan 2021 05:49:43 +0000 (14:49 +0900)
src/Tizen.NUI/src/internal/Model3dView.cs
src/Tizen.NUI/src/internal/RenderTask.cs

index 442c1a7e578016ba0e729f327ccb78785c6d7396..d137c8d3d2c651890eafdd283fc616808ad1e306 100755 (executable)
@@ -89,104 +89,136 @@ namespace Tizen.NUI
         {
             get
             {
-                string temp;
-                GetProperty(Model3dView.Property.GeometryUrl).Get(out temp);
-                return temp;
+                string retVal = "";
+                PropertyValue geometry = GetProperty(Model3dView.Property.GeometryUrl);
+                geometry?.Get(out retVal);
+                geometry?.Dispose();
+                return retVal;
             }
             set
             {
-                SetProperty(Model3dView.Property.GeometryUrl, new Tizen.NUI.PropertyValue(value));
+                PropertyValue setVal = new Tizen.NUI.PropertyValue(value);
+                SetProperty(Model3dView.Property.GeometryUrl, setVal);
+                setVal?.Dispose();
             }
         }
         public string MaterialUrl
         {
             get
             {
-                string temp;
-                GetProperty(Model3dView.Property.MaterialUrl).Get(out temp);
-                return temp;
+                string retVal = "" ;
+                PropertyValue material = GetProperty(Model3dView.Property.MaterialUrl);
+                material?.Get(out retVal);
+                material?.Dispose();
+                return retVal;
             }
             set
             {
-                SetProperty(Model3dView.Property.MaterialUrl, new Tizen.NUI.PropertyValue(value));
+                PropertyValue setVal = new Tizen.NUI.PropertyValue(value);
+                SetProperty(Model3dView.Property.MaterialUrl, setVal);
+                setVal?.Dispose();
             }
         }
         public string ImagesUrl
         {
             get
             {
-                string temp;
-                GetProperty(Model3dView.Property.ImagesUrl).Get(out temp);
-                return temp;
+                string retVal = "";
+                PropertyValue images = GetProperty(Model3dView.Property.ImagesUrl);
+                images?.Get(out retVal);
+                images?.Dispose();
+                return retVal;
             }
             set
             {
-                SetProperty(Model3dView.Property.ImagesUrl, new Tizen.NUI.PropertyValue(value));
+                PropertyValue setVal = new Tizen.NUI.PropertyValue(value);
+                SetProperty(Model3dView.Property.ImagesUrl, setVal);
+                setVal?.Dispose();
             }
         }
         public int IlluminationType
         {
             get
             {
-                int temp = 0;
-                GetProperty(Model3dView.Property.IlluminationType).Get(out temp);
-                return temp;
+                int retVal = 0;
+                PropertyValue illumination = GetProperty(Model3dView.Property.IlluminationType);
+                illumination?.Get(out retVal);
+                illumination?.Dispose();
+                return retVal;
             }
             set
             {
-                SetProperty(Model3dView.Property.IlluminationType, new Tizen.NUI.PropertyValue(value));
+                PropertyValue setVal = new Tizen.NUI.PropertyValue(value);
+                SetProperty(Model3dView.Property.IlluminationType, setVal);
+                setVal?.Dispose();
             }
         }
         public string Texture0Url
         {
             get
             {
-                string temp;
-                GetProperty(Model3dView.Property.Texture0Url).Get(out temp);
-                return temp;
+                string retVal = "";
+                PropertyValue texture0 = GetProperty(Model3dView.Property.Texture0Url);
+                texture0?.Get(out retVal);
+                texture0?.Dispose();
+                return retVal;
             }
             set
             {
-                SetProperty(Model3dView.Property.Texture0Url, new Tizen.NUI.PropertyValue(value));
+                PropertyValue setVal = new Tizen.NUI.PropertyValue(value);
+                SetProperty(Model3dView.Property.Texture0Url, setVal);
+                setVal?.Dispose();
             }
         }
         public string Texture1Url
         {
             get
             {
-                string temp;
-                GetProperty(Model3dView.Property.Texture1Url).Get(out temp);
-                return temp;
+                string retVal = "";
+                PropertyValue texture1 = GetProperty(Model3dView.Property.Texture1Url);
+                texture1?.Get(out retVal);
+                texture1?.Dispose();
+                return retVal;
             }
             set
             {
-                SetProperty(Model3dView.Property.Texture1Url, new Tizen.NUI.PropertyValue(value));
+                PropertyValue setVal = new Tizen.NUI.PropertyValue(value);
+                SetProperty(Model3dView.Property.Texture1Url, setVal);
+                setVal?.Dispose();
             }
         }
         public string Texture2Url
         {
             get
             {
-                string temp;
-                GetProperty(Model3dView.Property.Texture2Url).Get(out temp);
-                return temp;
+                string retVal = "";
+                PropertyValue texture2 = GetProperty(Model3dView.Property.Texture2Url);
+                texture2?.Get(out retVal);
+                texture2?.Dispose();
+                return retVal;
             }
             set
             {
-                SetProperty(Model3dView.Property.Texture2Url, new Tizen.NUI.PropertyValue(value));
+                PropertyValue setVal = new Tizen.NUI.PropertyValue(value);
+                SetProperty(Model3dView.Property.Texture2Url, setVal);
+                setVal?.Dispose();
             }
         }
         public Vector3 LightPosition
         {
             get
             {
-                Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
-                GetProperty(Model3dView.Property.LightPosition).Get(temp);
-                return temp;
+                Vector3 retVal = new Vector3(0.0f, 0.0f, 0.0f);
+                PropertyValue lightPos = GetProperty(Model3dView.Property.LightPosition);
+                lightPos?.Get(retVal);
+                lightPos?.Dispose();
+                return retVal;
             }
             set
             {
-                SetProperty(Model3dView.Property.LightPosition, new Tizen.NUI.PropertyValue(value));
+                PropertyValue setVal = new Tizen.NUI.PropertyValue(value);
+                SetProperty(Model3dView.Property.LightPosition, setVal);
+                setVal?.Dispose();
             }
         }
     }
index e54fb427011baab17110fd423b197ea9e369cf00..2732266a36db7c14385b9dfaa53ba159348fa70f 100755 (executable)
@@ -381,52 +381,68 @@ namespace Tizen.NUI
         {
             get
             {
-                Vector2 temp = new Vector2(0.0f, 0.0f);
-                GetProperty(RenderTask.Property.ViewportPosition).Get(temp);
-                return temp;
+                Vector2 retVal = new Vector2(0.0f, 0.0f);
+                PropertyValue viewportPos = GetProperty(RenderTask.Property.ViewportPosition);
+                viewportPos?.Get(retVal);
+                viewportPos?.Dispose();
+                return retVal;
             }
             set
             {
-                SetProperty(RenderTask.Property.ViewportPosition, new Tizen.NUI.PropertyValue(value));
+                PropertyValue setVal = new Tizen.NUI.PropertyValue(value);
+                SetProperty(RenderTask.Property.ViewportPosition, setVal);
+                setVal?.Dispose();
             }
         }
         public Vector2 ViewportSize
         {
             get
             {
-                Vector2 temp = new Vector2(0.0f, 0.0f);
-                GetProperty(RenderTask.Property.ViewportSize).Get(temp);
-                return temp;
+                Vector2 retVal = new Vector2(0.0f, 0.0f);
+                PropertyValue viewportSize = GetProperty(RenderTask.Property.ViewportSize);
+                viewportSize?.Get(retVal);
+                viewportSize?.Dispose();
+                return retVal;
             }
             set
             {
-                SetProperty(RenderTask.Property.ViewportSize, new Tizen.NUI.PropertyValue(value));
+                PropertyValue setVal = new Tizen.NUI.PropertyValue(value);
+                SetProperty(RenderTask.Property.ViewportSize, setVal);
+                setVal?.Dispose();
             }
         }
         public Vector4 ClearColor
         {
             get
             {
-                Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
-                GetProperty(RenderTask.Property.ClearColor).Get(temp);
-                return temp;
+                Vector4 retVal = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
+                PropertyValue clearColor = GetProperty(RenderTask.Property.ClearColor);
+                clearColor?.Get(retVal);
+                clearColor?.Dispose();
+                return retVal;
             }
             set
             {
-                SetProperty(RenderTask.Property.ClearColor, new Tizen.NUI.PropertyValue(value));
+                PropertyValue setVal = new Tizen.NUI.PropertyValue(value);
+                SetProperty(RenderTask.Property.ClearColor, setVal);
+                setVal?.Dispose();
             }
         }
         public bool RequiresSync
         {
             get
             {
-                bool temp = false;
-                GetProperty(RenderTask.Property.RequiresSync).Get(out temp);
-                return temp;
+                bool retVal = false;
+                PropertyValue reqSync = GetProperty(RenderTask.Property.RequiresSync);
+                reqSync?.Get(out retVal);
+                reqSync?.Dispose();
+                return retVal;
             }
             set
             {
-                SetProperty(RenderTask.Property.RequiresSync, new Tizen.NUI.PropertyValue(value));
+                PropertyValue setVal = new Tizen.NUI.PropertyValue(value);
+                SetProperty(RenderTask.Property.RequiresSync, setVal);
+                setVal?.Dispose();
             }
         }
     }