Update CSSNodeFree for C#, Java and Objective-C
Summary: - Update CSSNodeFree to unlink parent and children for C#, Java and Objective-C bindings finalizer. - [C#] Fix build (Fix #232) - [C#] Add Clear API for convenience as CSSNodeFreeRecursive. - [C#] Revise and add unit tests Reviewed By: emilsjolander Differential Revision: D4069655 fbshipit-source-id: 1fd764059784d7968af38b6aaf7fb6f70fdee8ee
This commit is contained in:
committed by
Facebook Github Bot
parent
4d0e657653
commit
2168d68007
@@ -15,7 +15,7 @@ using System.Text;
|
||||
|
||||
namespace Facebook.CSSLayout
|
||||
{
|
||||
public class CSSNode : IDisposable, IEnumerable<CSSNode>
|
||||
public class CSSNode : IEnumerable<CSSNode>
|
||||
{
|
||||
private IntPtr _cssNode;
|
||||
|
||||
@@ -35,7 +35,6 @@ namespace Facebook.CSSLayout
|
||||
{
|
||||
throw new InvalidOperationException("Failed to allocate native memory");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
~CSSNode()
|
||||
@@ -483,6 +482,14 @@ namespace Facebook.CSSLayout
|
||||
Native.CSSNodeRemoveChild(_cssNode, child._cssNode);
|
||||
}
|
||||
|
||||
public void Clear()
|
||||
{
|
||||
while (_children.Count > 0)
|
||||
{
|
||||
RemoveAt(0);
|
||||
}
|
||||
}
|
||||
|
||||
public int IndexOf(CSSNode node)
|
||||
{
|
||||
return _children.IndexOf(node);
|
||||
|
Reference in New Issue
Block a user