Skip to content
Snippets Groups Projects
Commit a6e8fe6c authored by Tianqi Chen's avatar Tianqi Chen Committed by GitHub
Browse files

[FFI] Fix global free destruction (#985)

parent e374abf8
No related branches found
No related tags found
No related merge requests found
......@@ -165,7 +165,7 @@ class FunctionBase(object):
self.is_global = is_global
def __del__(self):
if not self.is_global:
if not self.is_global and _LIB is not None:
check_call(_LIB.TVMFuncFree(self.handle))
def __call__(self, *args):
......
......@@ -44,7 +44,8 @@ class NodeBase(object):
self.handle = handle
def __del__(self):
check_call(_LIB.TVMNodeFree(self.handle))
if _LIB is not None:
check_call(_LIB.TVMNodeFree(self.handle))
def __getattr__(self, name):
ret_val = TVMValue()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment