dali 1.2.28 version upgrade
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / internal / SlotObserver.cs
index 2066b0b..db65be6 100755 (executable)
@@ -8,9 +8,9 @@
 // the SWIG interface file instead.
 //------------------------------------------------------------------------------
 
-namespace Tizen.NUI {
-
-public class SlotObserver : global::System.IDisposable {
+namespace Tizen.NUI {\r
+\r
+    internal class SlotObserver : global::System.IDisposable {
   private global::System.Runtime.InteropServices.HandleRef swigCPtr;
   protected bool swigCMemOwn;
 
@@ -24,10 +24,15 @@ public class SlotObserver : global::System.IDisposable {
   }
 
   ~SlotObserver() {
-    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 SlotObserver : global::System.IDisposable {
     }
   }
 
+
   public virtual void SlotDisconnected(SWIGTYPE_p_Dali__CallbackBase callback) {
     NDalicPINVOKE.SlotObserver_SlotDisconnected(swigCPtr, SWIGTYPE_p_Dali__CallbackBase.getCPtr(callback));
     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();