Switched to using SafeHandle for native code interrupt #297
Reference in New Issue
Block a user
No description provided.
Delete Branch "fix/issue_295"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR fixes issue #295
@splhack has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
@@ -23,0 +37,4 @@
protected override bool ReleaseHandle()
{
Native.YGNodeFree(this.handle);
GC.KeepAlive(this);
Out of curiosity, why do we need the GC.KeepAlive here?
@@ -99,3 +121,3 @@
[DllImport(DllName)]
public static extern void YGNodeSetHasNewLayout(IntPtr node, [MarshalAs(UnmanagedType.I1)] bool hasNewLayout);
public static extern void YGNodeSetHasNewLayout(YGNodeHandle node, [MarshalAs(UnmanagedType.I1)] bool hasNewLayout);
I think this must return only intptr as we don't own the underlying node here.
@@ -99,3 +121,3 @@
[DllImport(DllName)]
public static extern void YGNodeSetHasNewLayout(IntPtr node, [MarshalAs(UnmanagedType.I1)] bool hasNewLayout);
public static extern void YGNodeSetHasNewLayout(YGNodeHandle node, [MarshalAs(UnmanagedType.I1)] bool hasNewLayout);
I'll remove this declaration in merge commit since managed code doesn't use it
@@ -99,3 +121,3 @@
[DllImport(DllName)]
public static extern void YGNodeSetHasNewLayout(IntPtr node, [MarshalAs(UnmanagedType.I1)] bool hasNewLayout);
public static extern void YGNodeSetHasNewLayout(YGNodeHandle node, [MarshalAs(UnmanagedType.I1)] bool hasNewLayout);
You guys beat me to it. Thank you for noticing this one (@woehrl01) and removing it (@splhack). It could have caused some confusion and lifetime problems. We should similarly remove
YGNodeSetContext
andYGNodeSetContext
since this functionality is achieved by theYogaNode::Data
property.@@ -23,0 +37,4 @@
protected override bool ReleaseHandle()
{
Native.YGNodeFree(this.handle);
GC.KeepAlive(this);
Likely not necessary, but I wasn't sure of the implementation of the parent class. Shouldn't hurt.
Pull request closed