Merge pull request #165 from robertbaldyga/ctx-get-put

Give ocf_ctx get/put semantics
This commit is contained in:
Jan Musiał
2019-05-24 14:29:04 +02:00
committed by GitHub
8 changed files with 42 additions and 28 deletions

View File

@@ -51,7 +51,7 @@ class OcfCtx:
logger_priv=cast(pointer(logger.get_priv()), c_void_p),
)
result = self.lib.ocf_ctx_init(byref(self.ctx_handle), byref(self.cfg))
result = self.lib.ocf_ctx_create(byref(self.ctx_handle), byref(self.cfg))
if result != 0:
raise OcfError("Context initialization failed", result)
@@ -95,9 +95,7 @@ class OcfCtx:
self.stop_caches()
self.cleanup_volume_types()
result = self.lib.ocf_ctx_exit(self.ctx_handle)
if result != 0:
raise OcfError("Failed quitting OcfCtx", result)
self.lib.ocf_ctx_put(self.ctx_handle)
self.cfg = None
self.logger = None