Tizen.Log.Fatal("NUI", "Dali and NUI are version mismatched!");
}
- NUIApplicationInitEventArgs e = new NUIApplicationInitEventArgs();
+ // Initialize DisposeQueue Singleton class. This is also required to create DisposeQueue on main thread.
+ DisposeQueue.Instance.Initialize();
+ NUIApplicationInitEventArgs e = new NUIApplicationInitEventArgs();
// Populate all members of "e" (NUIApplicationInitEventArgs) with real data
e.Application = Application.GetApplicationFromPtr(data);
-
if (_applicationInitEventHandler != null)
{
//here we send all data to user event handlers
_applicationInitEventHandler(this, e);
}
-
- // Initialize DisposeQueue Singleton class. This is also required to create DisposeQueue on main thread.
- DisposeQueue.Instance.Initialize();
}
/**
internal Timer(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Timer_SWIGUpcast(cPtr), cMemoryOwn)
{
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
+
+ _timerTickCallbackDelegate = OnTick;
+ _timerTickCallbackOfNative = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate<System.Delegate>(_timerTickCallbackDelegate);
+
+ NUILog.Debug($"(0x{swigCPtr.Handle:X})Timer() contructor!");
+ }
+
+ ~Timer()
+ {
+ NUILog.Debug($"(0x{swigCPtr.Handle:X})Timer() distructor!, disposed={disposed}");
}
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Timer obj)
/// <since_tizen> 3 </since_tizen>
protected override void Dispose(DisposeTypes type)
{
+ NUILog.Debug($"(0x{swigCPtr.Handle:X}) Timer.Dispose(type={type}, disposed={disposed})");
+
+ if (_timerTickCallbackDelegate != null)
+ {
+ TickSignal().Disconnect(_timerTickCallbackOfNative);
+ }
+
if (disposed)
{
return;
//You should not access any managed member here except static instance.
//because the execution order of Finalizes is non-deterministic.
- if (_timerTickCallbackDelegate != null)
- {
- TickSignal().Disconnect(_timerTickCallbackDelegate);
- }
-
if (swigCPtr.Handle != global::System.IntPtr.Zero)
{
if (swigCMemOwn)
private EventHandlerWithReturnType<object, TickEventArgs, bool> _timerTickEventHandler;
private TickCallbackDelegate _timerTickCallbackDelegate;
+ private System.IntPtr _timerTickCallbackOfNative;
+
/// <summary>
/// @brief Event for the ticked signal, which can be used to subscribe or unsubscribe the event handler
/// provided by the user. The ticked signal is emitted after specified time interval.<br />
{
add
{
- if (_timerTickEventHandler == null)
+ if (_timerTickEventHandler == null && disposed == false)
{
- _timerTickCallbackDelegate = (OnTick);
- TickSignal().Connect(_timerTickCallbackDelegate);
+ TickSignal().Connect(_timerTickCallbackOfNative);
}
_timerTickEventHandler += value;
}
_timerTickEventHandler -= value;
if (_timerTickEventHandler == null && TickSignal().Empty() == false)
{
- TickSignal().Disconnect(_timerTickCallbackDelegate);
+ TickSignal().Disconnect(_timerTickCallbackOfNative);
}
}
}
if (played == false)
{
- Tizen.Log.Fatal("NUI", $"({swigCPtr.Handle}) OnTick() is called even played is false!");
+ Tizen.Log.Fatal("NUI", $"(0x{swigCPtr.Handle:X}) OnTick() is called even played is false!");
+ //throw new System.InvalidOperationException($"OnTick() excpetion!");
}
if (_timerTickEventHandler != null && played == true)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- Tizen.Log.Error("NUI", $"({swigCPtr.Handle}) Timer({milliSec}) Constructor!");
+ NUILog.Debug($"(0x{swigCPtr.Handle:X}) Timer({milliSec}) Constructor!");
}
internal Timer(Timer timer) : this(NDalicPINVOKE.new_Timer__SWIG_1(Timer.getCPtr(timer)), true)
{
/// <param name="milliSec">MilliSec interval in milliseconds.</param>
internal void SetInterval(uint milliSec)
{
+ NUILog.Debug($"(0x{swigCPtr.Handle:X})SetInterval({milliSec})");
- Tizen.Log.Error("NUI", $"({swigCPtr.Handle}) SetInterval({milliSec})");
played = true;
NDalicPINVOKE.Timer_SetInterval(swigCPtr, milliSec);
{
uint ret = NDalicPINVOKE.Timer_GetInterval(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- Tizen.Log.Error("NUI", $"({swigCPtr.Handle})GetInterval({ret})");
return ret;
}