[libvirt] [PATCH] Free object after *Destroy in python bindings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch below fixes an issue in the python bindings with the
vir*Destroy methods. After the object is successfully destroyed,
the payload is cleared, using 'self._o = None'. This unfortunately
screws up virt object reference counts, as the payload should be 
free'd using the appropriate vir*Free function.

Thanks,
Cole
diff --git a/python/generator.py b/python/generator.py
index cb57bff..9421981 100755
--- a/python/generator.py
+++ b/python/generator.py
@@ -629,10 +629,10 @@ function_classes = {}
 function_classes["None"] = []
 
 function_post = {
-    'virDomainDestroy': "self._o = None",
-    'virNetworkDestroy': "self._o = None",
-    'virStoragePoolDestroy': "self._o = None",
-    'virStorageVolDestroy': "self._o = None",
+    'virDomainDestroy': "del(self)",
+    'virNetworkDestroy': "del(self)",
+    'virStoragePoolDestroy': "del(self)",
+    'virStorageVolDestroy': "del(self)",
 }
 
 # Functions returning an integral type which need special rules to
--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]