当前位置: 首页>>代码示例>>Python>>正文


Python _ctypes.dlclose方法代码示例

本文整理汇总了Python中_ctypes.dlclose方法的典型用法代码示例。如果您正苦于以下问题:Python _ctypes.dlclose方法的具体用法?Python _ctypes.dlclose怎么用?Python _ctypes.dlclose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在_ctypes的用法示例。


在下文中一共展示了_ctypes.dlclose方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _FreePLC

# 需要导入模块: import _ctypes [as 别名]
# 或者: from _ctypes import dlclose [as 别名]
def _FreePLC(self):
        """
        Unload PLC library.
        This is also called by __init__ to create dummy C func proxies
        """
        self.PLClibraryLock.acquire()
        try:
            # Unload library explicitely
            if getattr(self, "_PLClibraryHandle", None) is not None:
                dlclose(self._PLClibraryHandle)

            # Forget all refs to library
            self._InitPLCStubCalls()

        finally:
            self.PLClibraryLock.release()

        return False 
开发者ID:thiagoralves,项目名称:OpenPLC_Editor,代码行数:20,代码来源:PLCObject.py

示例2: cleanup_lib

# 需要导入模块: import _ctypes [as 别名]
# 或者: from _ctypes import dlclose [as 别名]
def cleanup_lib(self):
        """ unload the previously loaded shared library """
        if not self.using_openmp:
            #this if statement is necessary because shared libraries that use
            #OpenMP will core dump when unloaded, this is a well-known issue with OpenMP
            logging.debug('unloading shared library')
            _ctypes.dlclose(self.lib._handle) 
开发者ID:benvanwerkhoven,项目名称:kernel_tuner,代码行数:9,代码来源:c.py

示例3: close

# 需要导入模块: import _ctypes [as 别名]
# 或者: from _ctypes import dlclose [as 别名]
def close(self):
        if self.system == 'windows':
            _ctypes.FreeLibrary(self.kunpeng._handle)
        else:
            handle = self.kunpeng._handle
            del self.kunpeng
            _ctypes.dlclose(handle) 
开发者ID:ysrc,项目名称:xunfeng,代码行数:9,代码来源:kunpeng.py

示例4: deleteCB

# 需要导入模块: import _ctypes [as 别名]
# 或者: from _ctypes import dlclose [as 别名]
def deleteCB(self, offset):
        """Free the state associated to @offset and delete it
        @offset: gcc state offset
        """
        flib = None
        if is_win:
            flib = _ctypes.FreeLibrary
        else:
            flib = _ctypes.dlclose
        flib(self.states[offset]._handle)
        del self.states[offset] 
开发者ID:cea-sec,项目名称:miasm,代码行数:13,代码来源:jitcore_gcc.py

示例5: __del__

# 需要导入模块: import _ctypes [as 别名]
# 或者: from _ctypes import dlclose [as 别名]
def __del__(self):

        if self._lib and self._fd:
            self._lib.uinput_destroy(self._fd)
            self._fd = None
            _ctypes.dlclose(self._lib._handle)
            self._lib = None 
开发者ID:ynsta,项目名称:steamcontroller,代码行数:9,代码来源:uinput.py

示例6: close

# 需要导入模块: import _ctypes [as 别名]
# 或者: from _ctypes import dlclose [as 别名]
def close(self):

        # unload the models on the C++ side
        _unload_models = self.libptr.unload_models
        _unload_models.restype = None
        _unload_models.argtypes = [c.c_void_p]
        self.libptr.unload_models(self._zpar_session_obj)

        # clean up the data structures on the python side
        if self.tagger:
            self.tagger.cleanup()

        if self.parser:
            self.parser.cleanup()

        if self.depparser:
            self.depparser.cleanup()

        # set all the fields to none to enable clean reuse
        self.tagger = None
        self.parser = None
        self.depparser = None
        self.modelpath = None

        # clean up the CDLL object too so that upon reuse, we get a new one
        _ctypes.dlclose(self.libptr._handle)
        # pretty sure once the old object libptr was pointed to should
        # get garbage collected at some point after this
        self.libptr = None
        self._zpar_session_obj = None 
开发者ID:EducationalTestingService,项目名称:python-zpar,代码行数:32,代码来源:__init__.py


注:本文中的_ctypes.dlclose方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。