[PATCH 3/8] conf: replace g_clear_pointer(..., g_hash_table_unref) with virHashFree()

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

 



virHashFree() just calls g_hash_table_unref(), and it's more common
for libvirt code to call virHashFree() rather than the convoluted
calling of g_hash_table_unref() via g_clear_pointer().

Since the object containing the hashes is g_freed immediately after
the hashes are freed, there is no functional difference.

Signed-off-by: Laine Stump <laine@xxxxxxxxxx>
---
 src/conf/domain_addr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/conf/domain_addr.c b/src/conf/domain_addr.c
index 37dad20ade..a8648d5858 100644
--- a/src/conf/domain_addr.c
+++ b/src/conf/domain_addr.c
@@ -949,8 +949,8 @@ virDomainPCIAddressSetExtensionFree(virDomainPCIAddressSetPtr addrs)
     if (!addrs || !addrs->zpciIds)
         return;
 
-    g_clear_pointer(&addrs->zpciIds->uids, g_hash_table_unref);
-    g_clear_pointer(&addrs->zpciIds->fids, g_hash_table_unref);
+    virHashFree(addrs->zpciIds->uids);
+    virHashFree(addrs->zpciIds->fids);
 
     VIR_FREE(addrs->zpciIds);
 }
-- 
2.29.2




[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]

  Powered by Linux