From 9a8e2e62069ee1d496274bbdbea7fbc8ccc4bae2 Mon Sep 17 00:00:00 2001 From: "dongsug.song" Date: Tue, 25 Jul 2017 10:38:37 +0900 Subject: [PATCH] Revert "[Tizen] Temporary Fix to return the Layer as a View when Parent is a Layer." This reverts commit 251b0146e6c75880efb78ad446017c90a7a20317. Change-Id: I33f6dc513404d9b1abf8351664cfb10bbf16ebf3 --- src/Tizen.NUI/src/public/BaseComponents/View.cs | 22 +--------------------- src/Tizen.NUI/src/public/BaseHandle.cs | 17 +++++------------ src/Tizen.NUI/src/public/Window.cs | 8 ++------ 3 files changed, 8 insertions(+), 39 deletions(-) diff --git a/src/Tizen.NUI/src/public/BaseComponents/View.cs b/src/Tizen.NUI/src/public/BaseComponents/View.cs index 61ac23b..100800a 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/View.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/View.cs @@ -2119,31 +2119,11 @@ namespace Tizen.NUI.BaseComponents return ret; } - /*internal View GetParent() - { - IntPtr cPtr = NDalicPINVOKE.Actor_GetParent(swigCPtr); - - View ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as View; - - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - }*/ - internal View GetParent() { - View ret; IntPtr cPtr = NDalicPINVOKE.Actor_GetParent(swigCPtr); - BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(cPtr); - - if(basehandle is Layer) - { - View ret2 = new View(cPtr,false); - return ret2; - } - - ret = basehandle as View; + View ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as View; if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); diff --git a/src/Tizen.NUI/src/public/BaseHandle.cs b/src/Tizen.NUI/src/public/BaseHandle.cs index e0d7ecc..d14f943 100755 --- a/src/Tizen.NUI/src/public/BaseHandle.cs +++ b/src/Tizen.NUI/src/public/BaseHandle.cs @@ -21,26 +21,22 @@ namespace Tizen.NUI { private global::System.Runtime.InteropServices.HandleRef swigCPtr; protected bool swigCMemOwn; - private bool _registerMe; internal BaseHandle(global::System.IntPtr cPtr, bool cMemoryOwn) { - _registerMe = swigCMemOwn = cMemoryOwn; + swigCMemOwn = cMemoryOwn; swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); // using copy constructor to create another native handle so Registry.Unregister works fine. swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, NDalicPINVOKE.new_BaseHandle__SWIG_2(swigCPtr)); - if (_registerMe) - { - // Register this instance of BaseHandle in the registry. - Registry.Register(this); - } + // Register this instance of BaseHandle in the registry. + Registry.Register(this); } internal BaseHandle(global::System.IntPtr cPtr) { - _registerMe = swigCMemOwn = true; + swigCMemOwn = true; swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); // Register this instance of BaseHandle in the registry. @@ -105,10 +101,7 @@ namespace Tizen.NUI //because the execution order of Finalizes is non-deterministic. //Unreference this instance from Registry. - if (_registerMe) - { - Registry.Unregister(this); - } + Registry.Unregister(this); if (swigCPtr.Handle != global::System.IntPtr.Zero) { diff --git a/src/Tizen.NUI/src/public/Window.cs b/src/Tizen.NUI/src/public/Window.cs index 8520ee2..7a610fd 100755 --- a/src/Tizen.NUI/src/public/Window.cs +++ b/src/Tizen.NUI/src/public/Window.cs @@ -29,7 +29,6 @@ namespace Tizen.NUI { private global::System.Runtime.InteropServices.HandleRef swigCPtr; private global::System.Runtime.InteropServices.HandleRef stageCPtr; - private Layer _rootLayer; internal Window(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Window_SWIGUpcast(cPtr), cMemoryOwn) { @@ -565,12 +564,9 @@ namespace Tizen.NUI internal Layer GetRootLayer() { - if (_rootLayer == null) - _rootLayer = new Layer(NDalicPINVOKE.Stage_GetRootLayer(stageCPtr), true); - - + Layer ret = new Layer(NDalicPINVOKE.Stage_GetRootLayer(stageCPtr), true); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return _rootLayer; + return ret; } internal void SetBackgroundColor(Vector4 color) -- 2.7.4