private const string LogTag = "Tizen.Applications";
private Window _win;
private int _resId;
+ private bool _disposed = false;
/// <summary>
/// Initializes the EFLWindow class.
}
}
+ /// <summary>
+ /// Releases any unmanaged resources used by this object. Can also dispose any other disposable objects.
+ /// </summary>
+ /// <since_tizen> 6 </since_tizen>
+ /// <param name="disposing">If true, disposes any disposable objects. If false, does not dispose disposable objects.</param>
+ protected virtual void Dispose(bool disposing)
+ {
+ if (_disposed)
+ return;
+
+ if (disposing)
+ {
+ _win.Unrealize();
+ _win = null;
+ }
+ _disposed = true;
+ }
+
+ /// <summary>
+ /// Dispose the window resources
+ /// </summary>
+ /// <returns></returns>
+ /// <since_tizen> 6 </since_tizen>
+ public void Dispose()
+ {
+ Dispose(true);
+ GC.SuppressFinalize(this);
+ }
}
}
{
private Interop.CBApplication.FrameLifecycleCallbacks _callbacks;
private const string LogTag = "Tizen.Applications";
+ private IDictionary<string, IWindowInfo> _winDic = new Dictionary<string, IWindowInfo>();
internal FrameComponentStateManager(Type ctype, string id, ComponentBasedApplication parent) : base(ctype, id, parent)
{
if (win == null)
return IntPtr.Zero;
+ _winDic.Add(id, win);
if (!fc.OnCreate())
{
Log.Error(LogTag, "OnCreate fail");
if (fc.Handle == context)
{
fc.OnDestroy();
+ _winDic[fc.Id].Dispose();
RemoveComponent(fc);
break;
}
/// Interface for window information
/// </summary>
/// <since_tizen> 6 </since_tizen>
- public interface IWindowInfo
+ public interface IWindowInfo : IDisposable
{
/// <summary>
/// Gets window resource ID