Skip to content

Commit 9fc8ffa

Browse files
authored
Reset shared singleton instance on release (#158)
1 parent ecd27ce commit 9fc8ffa

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/viam/rpc/dial.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,10 +204,15 @@ def release(self):
204204
self._semaphore.decrement()
205205
if self._semaphore.count == 0:
206206
self._lib.free_rust_runtime(self._ptr)
207+
_Runtime._release()
207208

208209
def free_str(self, ptr: ctypes.c_void_p):
209210
self._lib.free_string(ptr)
210211

212+
@classmethod
213+
def _release(cls):
214+
del cls._shared
215+
211216

212217
async def dial(address: str, options: Optional[DialOptions] = None) -> ViamChannel:
213218
opts = options if options else DialOptions()

0 commit comments

Comments
 (0)