Merge branch 'facebook/master' into percentage-feature

This commit is contained in:
Lukas Woehrl
2016-12-23 21:14:08 +01:00
18 changed files with 636 additions and 300 deletions

View File

@@ -16,7 +16,7 @@ namespace Facebook.Yoga
{
public partial class YogaNode : IEnumerable<YogaNode>
{
private IntPtr _ygNode;
private Native.YGNodeHandle _ygNode;
private WeakReference _parent;
private List<YogaNode> _children;
private MeasureFunction _measureFunction;
@@ -28,17 +28,12 @@ namespace Facebook.Yoga
YogaLogger.Initialize();
_ygNode = Native.YGNodeNew();
if (_ygNode == IntPtr.Zero)
if (_ygNode.IsInvalid)
{
throw new InvalidOperationException("Failed to allocate native memory");
}
}
~YogaNode()
{
Native.YGNodeFree(_ygNode);
}
public void Reset()
{
_measureFunction = null;