mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-11-09 15:00:07 +00:00
21 lines
621 B
Python
21 lines
621 B
Python
|
def __del__(self):
|
||
|
try:
|
||
|
if self.cb:
|
||
|
libvirtmod.virStreamEventRemoveCallback(self._o)
|
||
|
except AttributeError:
|
||
|
pass
|
||
|
|
||
|
if self._o != None:
|
||
|
libvirtmod.virStreamFree(self._o)
|
||
|
self._o = None
|
||
|
|
||
|
def eventAddCallback(self, cb, opaque):
|
||
|
""" """
|
||
|
try:
|
||
|
self.cb = cb
|
||
|
self.opaque = opaque
|
||
|
ret = libvirtmod.virStreamEventAddCallback(self._o, self)
|
||
|
if ret == -1: raise libvirtError ('virStreamEventAddCallback() failed', conn=self._conn)
|
||
|
except AttributeError:
|
||
|
pass
|