samskalicky commented on a change in pull request #19016:
URL: https://github.com/apache/incubator-mxnet/pull/19016#discussion_r480903499
##########
File path: python/mxnet/library.py
##########
@@ -24,6 +24,17 @@
from .ndarray.register import _make_ndarray_function
from .symbol.register import _make_symbol_function
+class MXlib:
+ """Holds a pointed to a loaded shared library and closes it on
destruction"""
+ def __init__(self, handle):
+ self.handle = handle
+ def __del__(self):
+ libdl = ctypes.CDLL("libdl.so")
+ libdl.dlclose(self.handle)
Review comment:
this is how we close the library we loaded before, by using `libdl.so`
to call `dlcose`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]