dali 1.2.28 version upgrade
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / internal / ChildPropertyRegistration.cs
index c986c64..c88af81 100755 (executable)
@@ -8,9 +8,9 @@
 // the SWIG interface file instead.
 //------------------------------------------------------------------------------
 
-namespace Tizen.NUI {
-
-public class ChildPropertyRegistration : global::System.IDisposable {
+namespace Tizen.NUI {\r
+\r
+    internal class ChildPropertyRegistration : global::System.IDisposable {
   private global::System.Runtime.InteropServices.HandleRef swigCPtr;
   protected bool swigCMemOwn;
 
@@ -24,10 +24,15 @@ public class ChildPropertyRegistration : global::System.IDisposable {
   }
 
   ~ChildPropertyRegistration() {
-    Dispose();
+    DisposeQueue.Instance.Add(this);
   }
 
   public virtual void Dispose() {
+    if (!Stage.IsInstalled()) {
+      DisposeQueue.Instance.Add(this);
+      return;
+    }
+
     lock(this) {
       if (swigCPtr.Handle != global::System.IntPtr.Zero) {
         if (swigCMemOwn) {
@@ -40,6 +45,7 @@ public class ChildPropertyRegistration : global::System.IDisposable {
     }
   }
 
+
   public ChildPropertyRegistration(TypeRegistration registered, string name, int index, PropertyType type) : this(NDalicPINVOKE.new_ChildPropertyRegistration(TypeRegistration.getCPtr(registered), name, index, (int)type), true) {
     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
   }