Merge branch 'facebook/master' into percentage-feature
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user