We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3e138b6 commit 48b546eCopy full SHA for 48b546e
1 file changed
objectbox/objectbox.py
@@ -1,4 +1,4 @@
1
-# Copyright 2019-2021 ObjectBox Ltd. All rights reserved.
+# Copyright 2019-2023 ObjectBox Ltd. All rights reserved.
2
#
3
# Licensed under the Apache License, Version 2.0 (the "License");
4
# you may not use this file except in compliance with the License.
@@ -21,8 +21,6 @@ class ObjectBox:
21
def __init__(self, c_store: OBX_store_p):
22
self._c_store = c_store
23
24
- self._closed = False
25
-
26
def __del__(self):
27
self.close()
28
@@ -33,7 +31,7 @@ def write_tx(self):
33
31
return objectbox.transaction.write(self)
34
32
35
def close(self):
36
- if not self._closed:
37
- obx_store_close(self._c_store)
38
- self._closed = True
39
+ c_store_to_close = self._c_store
+ if c_store_to_close:
+ self._c_store = None
+ obx_store_close(c_store_to_close)
0 commit comments