// Callback for Application InitSignal
private void OnApplicationInit(IntPtr data)
{
- if (Version.DaliVersionMatchWithNUI() == false)
- {
- Tizen.Log.Fatal("NUI", "Dali and NUI are version mismatched!");
- }
-
// Initialize DisposeQueue Singleton class. This is also required to create DisposeQueue on main thread.
DisposeQueue.Instance.Initialize();
internal class NUILog
{
- //[Conditional("DEBUG_ON")]
+ [Conditional("DEBUG_ON")]
public static void Debug(string msg,
[CallerLineNumber] int lineNum = 0,
[CallerMemberName] string caller = null,
public Texture GetColorTexture()
{
- Texture texture = new Texture(NDalicPINVOKE.FrameBuffer_GetColorTexture(swigCPtr), true);
- Texture ret = Registry.GetManagedBaseHandleFromNativePtr(texture) as Texture;
+ //to fix memory leak issue, match the handle count with native side.
+ global::System.IntPtr cPtr = NDalicPINVOKE.FrameBuffer_GetColorTexture(swigCPtr);
+ HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
+ Texture ret = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle) as Texture;
+ NDalicPINVOKE.delete_BaseHandle(CPtr);
+ CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
[global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint = "CSharp_ImageView_IMAGE_VISUAL_ACTION_STOP_get")]
public static extern int ImageView_IMAGE_VISUAL_ACTION_STOP_get();
- [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint = "CSharp_NUI_InternalAPIVersionCheck")]
- public static extern bool InternalAPIVersionCheck(ref int ver1, ref int ver2, ref int ver3);
-
}
}
public static extern uint GetMaxTextureSize();
}
-
}
+
*/
using System;
-using System.Collections.Concurrent;
+using System.Collections.Generic;
using System.Threading;
namespace Tizen.NUI
/// Given a C++ object, the dictionary allows us to find which C# object it belongs to.
/// By keeping the weak reference only, it will allow the object to be garbage collected.
/// </summary>
- private ConcurrentDictionary<IntPtr, WeakReference> _controlMap;
+ private Dictionary<IntPtr, WeakReference> _controlMap;
private Registry()
{
- _controlMap = new ConcurrentDictionary<IntPtr, WeakReference>();
+ _controlMap = new Dictionary<IntPtr, WeakReference>();
}
/// <param name="baseHandle">The instance of BaseHandle (C# base class).</param>
internal static void Register(BaseHandle baseHandle)
{
+
// We store a pointer to the RefObject for the control
RefObject refObj = baseHandle.GetObjectPtr();
IntPtr refCptr = (IntPtr)RefObject.getCPtr(refObj);
- RegistryCurrentThreadCheck();
+ //NUILog.Debug("Storing ref object cptr in control map Hex: {0:X}" + refCptr);
- if(Instance._controlMap.TryAdd(refCptr, new WeakReference(baseHandle, false)) != true)
+ if (!Instance._controlMap.ContainsKey(refCptr))
{
- NUILog.Debug("refCptr is already exist! OR something wrong!");
+ Instance._controlMap.Add(refCptr, new WeakReference(baseHandle, false));
}
return;
RefObject refObj = baseHandle.GetObjectPtr();
IntPtr refCptr = (IntPtr)RefObject.getCPtr(refObj);
- RegistryCurrentThreadCheck();
-
- WeakReference removeTarget;
- if(Instance._controlMap.TryRemove(refCptr, out removeTarget) != true)
+ if (Instance._controlMap.ContainsKey(refCptr))
{
- NUILog.Debug("something wrong when removing refCptr!");
+ Instance._controlMap.Remove(refCptr);
}
return;
RefObject refObj = baseHandle.GetObjectPtr();
IntPtr refObjectPtr = (IntPtr)RefObject.getCPtr(refObj);
+ if (refObjectPtr != null)
+ {
// we store a dictionary of ref-obects (C++ land) to managed obects (C# land)
return GetManagedBaseHandleFromRefObject(refObjectPtr);
}
+ else
+ {
+ NUILog.Error("NUI Registry RefObjectPtr is NULL!");
+ return null;
+ }
+ }
internal static BaseHandle GetManagedBaseHandleFromNativePtr(IntPtr cPtr)
{
IntPtr refObjectPtr = NDalicPINVOKE.GetRefObjectPtr(cPtr);
+ if (refObjectPtr != null)
+ {
// we store a dictionary of ref-obects (C++ land) to managed obects (C# land)
return GetManagedBaseHandleFromRefObject(refObjectPtr);
}
-
- internal static BaseHandle GetManagedBaseHandleFromRefObject(IntPtr refObjectPtr)
- {
- if (refObjectPtr == global::System.IntPtr.Zero)
+ else
{
- NUILog.Debug("Registry refObjectPtr is NULL! This means bind native object is NULL!");
+ NUILog.Error("NUI Registry RefObjectPtr is NULL!");
return null;
}
- else
- {
- NUILog.Debug($"refObjectPtr=0x{refObjectPtr.ToInt64():X}");
}
- RegistryCurrentThreadCheck();
-
+ internal static BaseHandle GetManagedBaseHandleFromRefObject(IntPtr refObjectPtr)
+ {
// we store a dictionary of ref-obects (C++ land) to managed obects (C# land)
WeakReference weakReference;
if (Instance._controlMap.TryGetValue(refObjectPtr, out weakReference))
{
- if(weakReference == null)
- {
- throw new System.InvalidOperationException("Error! NUI Registry weakReference should not be NULL!");
- }
-
+ if(weakReference == null) { throw new System.InvalidOperationException("Error! NUI Registry weakReference should not be NULL!"); }
BaseHandle ret = weakReference.Target as BaseHandle;
return ret;
}
}
}
- private static void RegistryCurrentThreadCheck()
- {
- if(savedApplicationThread == null)
- {
- Tizen.Log.Fatal("NUI", $"Error! maybe main thread is created by other process ");
- return;
- }
- int currentId = Thread.CurrentThread.ManagedThreadId;
- int mainThreadId = savedApplicationThread.ManagedThreadId;
-
- if(currentId != mainThreadId)
- {
- Tizen.Log.Fatal("NUI", $"Error! current thread({currentId}) which is NOT main thread({mainThreadId}) utilizes NUI object!");
- }
- }
-
-
}
}
*/
using System;
-using System.Diagnostics;
namespace Tizen.NUI
{
//This version should be updated and synced for every Dali native release
internal static class Version
{
- //dali_1.3.xx : NUI internal API version 500
- public const int nuiAPIVer = 500;
- public const int reservedVer1 = 0;
- public const int reservedVer2 = 0;
+ public const int daliVer1 = 1;
+ public const int daliVer2 = 2;
+ public const int daliVer3 = 83;
+ public const int nuiVer1 = 1;
+ public const int nuiVer2 = 2;
+ public const int nuiVer3 = 83;
+ public const string nuiRelease = "";
+
static internal bool DaliVersionMatchWithNUI()
{
try
{
- if (NDalicManualPINVOKE.InternalAPIVersionCheck(ref ver1, ref ver2, ref ver3) == true)
+ if (NDalicManualPINVOKE.NativeVersionCheck(ref ver1, ref ver2, ref ver3))
{
- if (ver1 != nuiAPIVer)
+ if (ver1 != daliVer1 || ver2 != daliVer2 || ver3 != daliVer3)
{
- NUILog.Error($"NUI API version mismatch error! NUI API Version: ({nuiAPIVer}) but read version from native: ({ver1}.{ver2}.{ver3})");
- throw new System.InvalidOperationException($"NUI API version mismatch error! NUI API version should be ({nuiAPIVer}) but read version from native: ({ver1}.{ver2}.{ver3})");
+ NUILog.Error($"Dali native version mismatch error! nui={ nuiVer1}.{ nuiVer2}.{ nuiVer3} but dali= { ver1 }.{ ver2}.{ ver3}");
+ throw new System.InvalidOperationException($"Dali native version mismatch error! nui={ nuiVer1}.{ nuiVer2}.{ nuiVer3} but dali={ ver1 }.{ ver2}.{ ver3}");
}
}
else
{
- NUILog.Error($"NUI API version mismatch error! NUI API Version: ({nuiAPIVer}) but read version from native: ({ver1}.{ver2}.{ver3})");
- throw new System.InvalidOperationException($"NUI API version mismatch error! NUI API version should be ({nuiAPIVer}) but read version from native: ({ver1}.{ver2}.{ver3})");
+ NUILog.Error($"Dali native version mismatch error! nui={ nuiVer1}.{ nuiVer2}.{ nuiVer3} but dali= { ver1 }.{ ver2}.{ ver3}");
+ throw new System.InvalidOperationException($"Dali native version mismatch error! nui={ nuiVer1}.{ nuiVer2}.{ nuiVer3} but dali={ ver1 }.{ ver2}.{ ver3}");
}
}
catch (Exception)
{
- NUILog.Error($"NUI API version mismatch error! NUI API Version: ({nuiAPIVer}) but read version from native: ({ver1}.{ver2}.{ver3})");
- throw new System.InvalidOperationException($"NUI API version mismatch error! NUI API version should be ({nuiAPIVer}) but read version from native: ({ver1}.{ver2}.{ver3})");
+ NUILog.Error($"Dali native version mismatch error! nui={ nuiVer1}.{ nuiVer2}.{ nuiVer3} but dali= { ver1 }.{ ver2}.{ ver3}");
+ throw new System.InvalidOperationException($"Dali native version mismatch error! nui={ nuiVer1}.{ nuiVer2}.{ nuiVer3} but dali={ ver1 }.{ ver2}.{ ver3}");
}
-
- PrintDaliNativeVersion();
+ NUILog.Debug($"version info: nui={ nuiVer1}.{ nuiVer2}.{ nuiVer3}, dali= { ver1 }.{ ver2}.{ ver3}");
return true;
}
-
- //[Conditional("DEBUG_ON")]
- static private void PrintDaliNativeVersion()
- {
- int ver1 = -1;
- int ver2 = -1;
- int ver3 = -1;
-
- NDalicManualPINVOKE.NativeVersionCheck(ref ver1, ref ver2, ref ver3);
- NUILog.Debug($"DALi Version: ({ver1}.{ver2}.{ver3}), NUI API Version: ({nuiAPIVer})");
- }
}
}
public VisualBase GetVisual(int index)
{
- VisualBase visualBase = new VisualBase(NDalicManualPINVOKE.ViewWrapperImpl_GetVisual(swigCPtr, index), true);
- VisualBase ret = Registry.GetManagedBaseHandleFromNativePtr(visualBase) as VisualBase;
+ //to fix memory leak issue, match the handle count with native side.
+ System.IntPtr cPtr = NDalicManualPINVOKE.ViewWrapperImpl_GetVisual(swigCPtr, index);
+ HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
+ VisualBase ret = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle) as VisualBase;
+ NDalicPINVOKE.delete_BaseHandle(CPtr);
+ CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
/// <since_tizen> 3 </since_tizen>
public View GetChildAt(TableView.CellPosition position)
{
- View view = new View(NDalicPINVOKE.TableView_GetChildAt(swigCPtr, TableView.CellPosition.getCPtr(position)), true, true);
- View ret = Registry.GetManagedBaseHandleFromNativePtr(view) as View;
+ //to fix memory leak issue, match the handle count with native side.
+ IntPtr cPtr = NDalicPINVOKE.TableView_GetChildAt(swigCPtr, TableView.CellPosition.getCPtr(position));
+ HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
+ View ret = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle) as View;
+ NDalicPINVOKE.delete_BaseHandle(CPtr);
+ CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
/// <since_tizen> 3 </since_tizen>
public View RemoveChildAt(TableView.CellPosition position)
{
- View view = new View(NDalicPINVOKE.TableView_RemoveChildAt(swigCPtr, TableView.CellPosition.getCPtr(position)), true, true);
- View ret = Registry.GetManagedBaseHandleFromNativePtr(view) as View;
+ //to fix memory leak issue, match the handle count with native side.
+ IntPtr cPtr = NDalicPINVOKE.TableView_RemoveChildAt(swigCPtr, TableView.CellPosition.getCPtr(position));
+ HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
+ View ret = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle) as View;
+ NDalicPINVOKE.delete_BaseHandle(CPtr);
+ CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
}
- internal View(global::System.IntPtr cPtr, bool cMemoryOwn, bool ignore) : base(NDalicPINVOKE.View_SWIGUpcast(cPtr), cMemoryOwn)
- {
- swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
- }
-
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(View obj)
{
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
if (NDalicPINVOKE.SWIGPendingException.Pending)
throw NDalicPINVOKE.SWIGPendingException.Retrieve();
Children.Add(child);
- child.SetParent(this);
}
}
throw NDalicPINVOKE.SWIGPendingException.Retrieve();
Children.Remove(child);
- child.SetParent(null);
}
/// <summary>
/// </summary>
/// <seealso cref="Container.GetParent()" />
/// <since_tizen> 4 </since_tizen>
- protected override Container GetParent()
+ public override Container GetParent()
{
- return Parent;
+ //to fix memory leak issue, match the handle count with native side.
+ IntPtr cPtr = NDalicPINVOKE.Actor_GetParent(swigCPtr);
+ HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
+ BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle);
+ NDalicPINVOKE.delete_BaseHandle(CPtr);
+ CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
+
+ if (NDalicPINVOKE.SWIGPendingException.Pending)
+ throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+
+ return basehandle as Container;
}
internal bool IsTopLevelView()
/// <since_tizen> 5 </since_tizen>
public Layer GetLayer()
{
- Layer layer = new Layer(NDalicPINVOKE.Actor_GetLayer(swigCPtr), true);
- Layer ret = Registry.GetManagedBaseHandleFromNativePtr(layer) as Layer;
+ //to fix memory leak issue, match the handle count with native side.
+ IntPtr cPtr = NDalicPINVOKE.Actor_GetLayer(swigCPtr);
+ HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
+ Layer ret = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle) as Layer;
+ NDalicPINVOKE.delete_BaseHandle(CPtr);
+ CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
if (NDalicPINVOKE.SWIGPendingException.Pending)
throw NDalicPINVOKE.SWIGPendingException.Retrieve();
/// <since_tizen> 3 </since_tizen>
public View FindChildByName(string viewName)
{
- View view = new View(NDalicPINVOKE.Actor_FindChildByName(swigCPtr, viewName), true, true);
- View ret = Registry.GetManagedBaseHandleFromNativePtr(view) as View;
+ //to fix memory leak issue, match the handle count with native side.
+ IntPtr cPtr = NDalicPINVOKE.Actor_FindChildByName(swigCPtr, viewName);
+ HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
+ View ret = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle) as View;
+ NDalicPINVOKE.delete_BaseHandle(CPtr);
+ CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
if (NDalicPINVOKE.SWIGPendingException.Pending)
throw NDalicPINVOKE.SWIGPendingException.Retrieve();
internal View FindChildById(uint id)
{
- View view = new View(NDalicPINVOKE.Actor_FindChildById(swigCPtr, id), true, true);
- View ret = Registry.GetManagedBaseHandleFromNativePtr(view) as View;
+ //to fix memory leak issue, match the handle count with native side.
+ IntPtr cPtr = NDalicPINVOKE.Actor_FindChildById(swigCPtr, id);
+ HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
+ View ret = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle) as View;
+ NDalicPINVOKE.delete_BaseHandle(CPtr);
+ CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
if (NDalicPINVOKE.SWIGPendingException.Pending)
throw NDalicPINVOKE.SWIGPendingException.Retrieve();
/// <since_tizen> 3 </since_tizen>
public Renderer GetRendererAt(uint index)
{
- Renderer renderer = new Renderer(NDalicPINVOKE.Actor_GetRendererAt(swigCPtr, index), true);
- Renderer ret = Registry.GetManagedBaseHandleFromNativePtr(renderer) as Renderer;
+ //to fix memory leak issue, match the handle count with native side.
+ IntPtr cPtr = NDalicPINVOKE.Actor_GetRendererAt(swigCPtr, index);
+ HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
+ Renderer ret = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle) as Renderer;
+ NDalicPINVOKE.delete_BaseHandle(CPtr);
+ CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
if (NDalicPINVOKE.SWIGPendingException.Pending)
throw NDalicPINVOKE.SWIGPendingException.Retrieve();
{
private List<View> _childViews = new List<View>();
- private Container _parent = null;
/// <summary>
/// List of children of Container.
}
/// <summary>
- /// This should be implemented in derived child classes such as View and Layer
- /// </summary>
- /// <returns>parent object of mine, which will be Container class</returns>
- protected abstract Container GetParent();
-
- /// <summary>
/// Adds a child view to this Container.
/// </summary>
/// <pre>This Container (the parent) has been initialized. The child view has been initialized. The child view is not the same as the parent view.</pre>
public abstract View GetChildAt( uint index );
/// <summary>
+ /// Gets the parent of this container.
+ /// </summary>
+ /// <pre>The child container has been initialized.</pre>
+ /// <returns>The parent container.</returns>
+ /// <since_tizen> 4 </since_tizen>
+ public abstract Container GetParent();
+
+ /// <summary>
/// Gets the number of children for this container.
/// </summary>
/// <pre>The container has been initialized.</pre>
{
get
{
- return _parent;
+ return GetParent();
}
}
- internal void SetParent(Container parent)
- {
- _parent = parent;
- }
-
/// <summary>
/// Gets the number of children for this container.
/// Read only
/// <since_tizen> 3 </since_tizen>
public View GetCurrentFocusView()
{
- View view = new View(NDalicManualPINVOKE.FocusManager_GetCurrentFocusActor(swigCPtr), true, true);
- View ret = Registry.GetManagedBaseHandleFromNativePtr(view) as View;
+ //to fix memory leak issue, match the handle count with native side.
+ IntPtr cPtr = NDalicManualPINVOKE.FocusManager_GetCurrentFocusActor(swigCPtr);
+ HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
+ View ret = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle) as View;
+ NDalicPINVOKE.delete_BaseHandle(CPtr);
+ CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
return ret;
}
/// <since_tizen> 3 </since_tizen>
public View GetFocusGroup(View view)
{
- View localView = new View(NDalicManualPINVOKE.FocusManager_GetFocusGroup(swigCPtr, View.getCPtr(view)), true, true);
- View ret = Registry.GetManagedBaseHandleFromNativePtr(localView) as View;
+ //to fix memory leak issue, match the handle count with native side.
+ IntPtr cPtr = NDalicManualPINVOKE.FocusManager_GetFocusGroup(swigCPtr, View.getCPtr(view));
+ HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
+ View ret = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle) as View;
+ NDalicPINVOKE.delete_BaseHandle(CPtr);
+ CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
return ret;
}
internal View GetFocusIndicatorView()
{
- View view = new View(NDalicManualPINVOKE.FocusManager_GetFocusIndicatorActor(swigCPtr), true, true);
- View ret = Registry.GetManagedBaseHandleFromNativePtr(view) as View;
+ //to fix memory leak issue, match the handle count with native side.
+ IntPtr cPtr = NDalicManualPINVOKE.FocusManager_GetFocusIndicatorActor(swigCPtr);
+ HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
+ View ret = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle) as View;
+ NDalicPINVOKE.delete_BaseHandle(CPtr);
+ CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
return ret;
}
if (NDalicPINVOKE.SWIGPendingException.Pending)
throw NDalicPINVOKE.SWIGPendingException.Retrieve();
Children.Add(child);
- child.SetParent(this);
}
}
throw NDalicPINVOKE.SWIGPendingException.Retrieve();
Children.Remove(child);
- child.SetParent(null);
}
/// <summary>
}
/// <summary>
- /// protected override method derived from Container abstract parent class
+ /// Get parent of the layer.
/// </summary>
- /// <returns>always return null, because in NUI, Layer can be added under Window</returns>
- protected override Container GetParent()
+ /// <returns>The view's container</returns>
+ /// <since_tizen> 4 </since_tizen>
+ public override Container GetParent()
{
return null;
}
/// <since_tizen> 3 </since_tizen>
public View FindChildById(uint id)
{
- View view = new View(NDalicPINVOKE.Actor_FindChildById(swigCPtr, id), true, true);
- View ret = Registry.GetManagedBaseHandleFromNativePtr(view) as View;
+ //to fix memory leak issue, match the handle count with native side.
+ IntPtr cPtr = NDalicPINVOKE.Actor_FindChildById(swigCPtr, id);
+ HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
+ View ret = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle) as View;
+ NDalicPINVOKE.delete_BaseHandle(CPtr);
+ CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
if (NDalicPINVOKE.SWIGPendingException.Pending)
throw NDalicPINVOKE.SWIGPendingException.Retrieve();
internal View GetTitle()
{
- View view = new View(NDalicPINVOKE.Popup_GetTitle(swigCPtr), true, true);
- View ret = Registry.GetManagedBaseHandleFromNativePtr(view) as View;
+ //to fix memory leak issue, match the handle count with native side.
+ IntPtr cPtr = NDalicPINVOKE.Popup_GetTitle(swigCPtr);
+ HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
+ View ret = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle) as View;
+ NDalicPINVOKE.delete_BaseHandle(CPtr);
+ CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
internal View GetContent()
{
- View view = new View(NDalicPINVOKE.Popup_GetContent(swigCPtr), true, true);
- View ret = Registry.GetManagedBaseHandleFromNativePtr(view) as View;
+ //to fix memory leak issue, match the handle count with native side.
+ IntPtr cPtr = NDalicPINVOKE.Popup_GetContent(swigCPtr);
+ HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
+ View ret = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle) as View;
+ NDalicPINVOKE.delete_BaseHandle(CPtr);
+ CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
internal View GetFooter()
{
- View view = new View(NDalicPINVOKE.Popup_GetFooter(swigCPtr), true, true);
- View ret = Registry.GetManagedBaseHandleFromNativePtr(view) as View;
+ //to fix memory leak issue, match the handle count with native side.
+ IntPtr cPtr = NDalicPINVOKE.Popup_GetFooter(swigCPtr);
+ HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
+ View ret = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle) as View;
+ NDalicPINVOKE.delete_BaseHandle(CPtr);
+ CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
/// </summary>
/// <param name="transparent">Whether the window is transparent.</param>
/// <since_tizen> 5 </since_tizen>
- public void SetTransparency(bool transparent)
- {
+ public void SetTransparency(bool transparent) {
NDalicManualPINVOKE.SetTransparency(swigCPtr, transparent);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// <param name="keyEvent">The key event to feed.</param>
/// <since_tizen> 4 </since_tizen>
[Obsolete("Please do not use! This will be deprecated! Please use FeedKey(Key keyEvent) instead!")]
- public void FeedKeyEvent(Key keyEvent)
+ public static void FeedKeyEvent(Key keyEvent)
{
NDalicManualPINVOKE.Window_FeedKeyEvent(Key.getCPtr(keyEvent));
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();