File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change 1
- # Copyright 2019-2021 ObjectBox Ltd. All rights reserved.
1
+ # Copyright 2019-2023 ObjectBox Ltd. All rights reserved.
2
2
#
3
3
# Licensed under the Apache License, Version 2.0 (the "License");
4
4
# you may not use this file except in compliance with the License.
@@ -21,8 +21,6 @@ class ObjectBox:
21
21
def __init__ (self , c_store : OBX_store_p ):
22
22
self ._c_store = c_store
23
23
24
- self ._closed = False
25
-
26
24
def __del__ (self ):
27
25
self .close ()
28
26
@@ -33,7 +31,7 @@ def write_tx(self):
33
31
return objectbox .transaction .write (self )
34
32
35
33
def close (self ):
36
- if not self ._closed :
37
- obx_store_close ( self . _c_store )
38
- self ._closed = True
39
-
34
+ c_store_to_close = self ._c_store
35
+ if c_store_to_close :
36
+ self ._c_store = None
37
+ obx_store_close ( c_store_to_close )
You can’t perform that action at this time.
0 commit comments