diff --git a/src/sora_sdk/__init__.py b/src/sora_sdk/__init__.py index 8c3f8e4..e4c77f0 100644 --- a/src/sora_sdk/__init__.py +++ b/src/sora_sdk/__init__.py @@ -55,14 +55,18 @@ def on_data(self, *args, **kwargs): class SoraVideoSource(): + _instances = [] + def __init__(self, sora, source): + SoraVideoSource._instances.append(self) self._sora = sora self.source = source - + def __del__(self): print("__del__ SoraVideoSource 1") self.source = None self._sora = None + SoraVideoSource._instances.remove(self) print("__del__ SoraVideoSource 2") def on_captured(self, *args, **kwargs): @@ -186,8 +190,9 @@ def __init__(self, *args, **kwargs): Sora._instances.append(self) def __del__(self): + print("__del__ Sora 1") Sora._instances.remove(self) - print("__del__ Sora") + print("__del__ Sora 2") def create_connection( self,