From d1cc52dff5f66fee83198a588bdd5da18b2ef985 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Mon, 29 Aug 2022 15:18:26 -0400 Subject: [PATCH] Use new public lifetime-stack class attr --- piker/data/_sharedmem.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/piker/data/_sharedmem.py b/piker/data/_sharedmem.py index 77fc5816..bc1ded75 100644 --- a/piker/data/_sharedmem.py +++ b/piker/data/_sharedmem.py @@ -528,9 +528,9 @@ def open_shm_array( # "unlink" created shm on process teardown by # pushing teardown calls onto actor context stack - # TODO: make this a public API in ``tractor``.. - tractor._runtime._lifetime_stack.callback(shmarr.close) - tractor._runtime._lifetime_stack.callback(shmarr.destroy) + stack = tractor.current_actor().lifetime_stack + stack.callback(shmarr.close) + stack.callback(shmarr.destroy) return shmarr @@ -614,8 +614,8 @@ def attach_shm_array( if key not in _known_tokens: _known_tokens[key] = token - # "close" attached shm on process teardown - tractor._runtime._lifetime_stack.callback(sha.close) + # "close" attached shm on actor teardown + tractor.current_actor().lifetime_stack.callback(sha.close) return sha