[NUI] Fix Renderer null issue (#758)
authorhuiyueun <35286162+huiyueun@users.noreply.github.com>
Wed, 20 Mar 2019 06:57:47 +0000 (15:57 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Wed, 20 Mar 2019 06:57:47 +0000 (15:57 +0900)
Signed-off-by: huiyu.eun <huiyu.eun@samsung.com>
src/Tizen.NUI/src/public/BaseComponents/View.cs
src/Tizen.NUI/src/public/Renderer.cs
src/Tizen.NUI/src/public/TextureSet.cs

index 3bcc0b1..09606c2 100644 (file)
@@ -4212,6 +4212,13 @@ namespace Tizen.NUI.BaseComponents
             IntPtr cPtr = NDalicPINVOKE.Actor_GetRendererAt(swigCPtr, index);
             HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
             Renderer ret = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle) as Renderer;
+            if (cPtr != null && ret == null)
+            {
+                ret = new Renderer(cPtr, false);
+                if (NDalicPINVOKE.SWIGPendingException.Pending)
+                    throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+                return ret;
+            }
             NDalicPINVOKE.delete_BaseHandle(CPtr);
             CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
 
index 929bbae..c9b3d5f 100755 (executable)
@@ -532,6 +532,12 @@ namespace Tizen.NUI
             System.IntPtr cPtr = NDalicPINVOKE.Renderer_GetTextures(swigCPtr);
             HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
             TextureSet ret = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle) as TextureSet;
+            if (cPtr != null && ret == null)
+            {
+                ret = new TextureSet(cPtr, false);
+                if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+                return ret;
+            }
             NDalicPINVOKE.delete_BaseHandle(CPtr);
             CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
 
index 4fdf1e7..42688b4 100755 (executable)
@@ -67,6 +67,12 @@ namespace Tizen.NUI
             System.IntPtr cPtr = NDalicPINVOKE.TextureSet_GetTexture(swigCPtr, index);
             HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
             Texture ret = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle) as Texture;
+            if (cPtr != null && ret == null)
+            {
+                ret = new Texture(cPtr, false);
+                if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+                return ret;
+            }
             NDalicPINVOKE.delete_BaseHandle(CPtr);
             CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);