Remove unused GCHandle
Summary: - Unused _context GCHandle prevent calling CSSNode destructor. - CSSNode C# impl will retain children node when calling CSSNodeInsertChild, so the lifetime of C# object is the same as the lifetime of native instance. Reviewed By: emilsjolander Differential Revision: D3981697 fbshipit-source-id: 71f0f7be97fd694d27934d7d07deb64ee08b2840
This commit is contained in:
committed by
Facebook Github Bot
parent
56279110c0
commit
b57abb2f60
@@ -18,7 +18,6 @@ namespace Facebook.CSSLayout
|
||||
{
|
||||
private bool _isDisposed;
|
||||
private IntPtr _cssNode;
|
||||
private IntPtr _context;
|
||||
|
||||
private CSSNode _parent;
|
||||
private List<CSSNode> _children;
|
||||
@@ -83,9 +82,7 @@ namespace Facebook.CSSLayout
|
||||
if (_cssNode != IntPtr.Zero)
|
||||
{
|
||||
Native.CSSNodeFree(_cssNode);
|
||||
GCHandle.FromIntPtr(_context).Free();
|
||||
_cssNode = IntPtr.Zero;
|
||||
_context = IntPtr.Zero;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,8 +94,6 @@ namespace Facebook.CSSLayout
|
||||
}
|
||||
|
||||
_cssNode = Native.CSSNodeNew();
|
||||
_context = (IntPtr)GCHandle.Alloc(this);
|
||||
Native.CSSNodeSetContext(_cssNode, _context);
|
||||
_children = new List<CSSNode>(4);
|
||||
Native.CSSNodeSetPrintFunc(_cssNode, _printFunc);
|
||||
}
|
||||
|
Reference in New Issue
Block a user