diff options
author | Philipp Hahn <hahn@univention.de> | 2010-07-13 10:54:26 +0200 |
---|---|---|
committer | Eric Blake <eblake@redhat.com> | 2010-07-23 13:26:40 -0600 |
commit | 1abf41565f9e434326aeb2d1d72754c424102b46 (patch) | |
tree | 48cfd074679aeca02310db4a112068bb11b0d020 /libvirt-override.py | |
parent | a877c16bac6edfb306501843ca313e1e1aabc68d (diff) | |
download | libvirt-python-v6-1abf41565f9e434326aeb2d1d72754c424102b46.tar.gz libvirt-python-v6-1abf41565f9e434326aeb2d1d72754c424102b46.tar.xz libvirt-python-v6-1abf41565f9e434326aeb2d1d72754c424102b46.zip |
When the last callback is removed using domainEventDeregister(), the
events dispatcher is deregistered from the C-library, but
domainEventsCallbacks is still an empty list.
On shutdown __del__() deregisters the dispatacher again, which SEGVs
# You need the event-loop implementation from the Python examples;
# give the file a name which is importable by Python.
ln examples/domain-events/events-python/event-test.py eloop.py
python -c 'from eloop import *
import sys
def dump(*args): print " ".join(map(str, args))
virEventLoopPureStart()
c = libvirt.open("xen:///")
c.domainEventRegister(dump, None)
c.domainEventDeregister(dump)
sys.exit(0)'
domainEventDeregister() needs to delete domainEventCallbacks so subsequent
calls to __del__() and domainEventRegister() choose the right code paths.
Setting it to None is not enough, since calling domainEventRegiser() again
would trigger an TypeError.
Signed-off-by: Philipp Hahn <hahn@univention.de>
Diffstat (limited to 'libvirt-override.py')
0 files changed, 0 insertions, 0 deletions