1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-27 18:55:19 +03:00
lvm2/python
Tony Asleson 20ffb0f721 python-lvm: Ensure library handle is correct after python gc() call
In a previous commit we added the ability for the library to do garbage
collection, to free all the memory used by the library handle buffer by closing
and re-opening the library handle.  When we introduced this functionality we
also opened up the opportunity that the user of the python bindings to have
an object that references the old library handle.  In this case if the user
tried to use the old object a segmentation fault could occur because the
memory had been previously freed.

This patch tries to mitigate this by storing a copy of the library handle that
was used when the object was created so that it can compare the current in
use pointer with what existed when the object was created.  In the case where
they match the operation is permitted to continue, otherwise an exception is
throw, thus avoiding a segmentation fault.

Signed-off-by: Tony Asleson <tasleson@redhat.com>
2013-11-19 14:40:27 -06:00
..
example.py python-lvm: Update example to work with lvm object removal. 2012-10-15 14:11:10 -07:00
liblvm.c python-lvm: Ensure library handle is correct after python gc() call 2013-11-19 14:40:27 -06:00
Makefile.in python: Introduce pyexecdir 2013-07-24 22:07:10 +01:00
setup.py.in python: Add bindings for liblvm2app. 2012-10-12 02:08:47 +01:00