Skip to content

Commit 9237cfc

Browse files
committed
Make a callback persistent, so it won't be GCed.
1 parent c25e282 commit 9237cfc

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

python/AsyncProxy.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,11 @@ def __init__(self, args:asyncproxy_ctor_args):
111111
raise Exception('asyncproxy_ctor() failed')
112112
self.__asp = _asp
113113
if self.in2out is not None:
114-
in2out = _asp_data_cb(self.in2out)
115-
self.__asp.asyncproxy_set_i2o(self._hndl, in2out)
114+
self._in2out_cb = _asp_data_cb(self.in2out)
115+
self.__asp.asyncproxy_set_i2o(self._hndl, self._in2out_cb)
116116
if self.out2in is not None:
117-
out2in = _asp_data_cb(self.out2in)
118-
self.__asp.asyncproxy_set_o2i(self._hndl, out2in)
117+
self._out2in_cb = _asp_data_cb(self.out2in)
118+
self.__asp.asyncproxy_set_o2i(self._hndl, self._out2in_cb)
119119

120120
def start(self):
121121
if int(self.__asp.asyncproxy_start(self._hndl)) != 0:

0 commit comments

Comments
 (0)