mirror of
git://sourceware.org/git/lvm2.git
synced 2025-03-08 08:58:50 +03:00
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>