]> xenbits.xensource.com Git - libvirt.git/commit
Implement dispose method for libxlDomainObjPrivate
authorFrediano Ziglio <frediano.ziglio@citrix.com>
Thu, 13 Jun 2013 15:35:11 +0000 (16:35 +0100)
committerJim Fehlig <jfehlig@suse.com>
Thu, 13 Jun 2013 22:12:39 +0000 (16:12 -0600)
commitd58ce13612837138a70291d7bab24128b5e9a255
tree9061e6ba969012da4cfd20e47bee3a77f47c15df
parent2903197539e8eb0a183ad943ce86e9af9ad705b8
Implement dispose method for libxlDomainObjPrivate

When creating a timer/event handler reference counting is used. So it could
be possible (in theory) that libxlDomainObjPrivateFree is called with
reference counting >1. The problem is that libxlDomainObjPrivateFree leave
the object in an invalid state with ctx freed (but still having dandling
pointer). This can lead timer/event handler to core.

This patch implements a dispose method for libxlDomainObjPrivate, and moves
freeing the libxl ctx to the dispose method, ensuring the ctx is valid while
the object's reference count is > 0.

Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
src/libxl/libxl_driver.c