Something like this?
Do you think that the virUnref*() functions should continue to error out
if the conn is invalid? Or should they maybe just refrain from grabbing
the conn mutex, but still decrement the ref count and release the object
when necessary?
(P.S. Is this patch mail formatted correctly? I'm doing this as much to
get the procedure correct as to fix the code...)
---
src/datatypes.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/datatypes.c b/src/datatypes.c
index b1013f2..eceb839 100644
--- a/src/datatypes.c
+++ b/src/datatypes.c
@@ -49,7 +49,7 @@
static int
virDomainFreeName(virDomainPtr domain, const char *name ATTRIBUTE_UNUSED)
{
- return (virDomainFree(domain));
+ return (virUnrefDomain(domain));
}
/**
@@ -63,7 +63,7 @@ virDomainFreeName(virDomainPtr domain, const char *name
ATTRIBUTE_UNUSED)
static int
virNetworkFreeName(virNetworkPtr network, const char *name ATTRIBUTE_UNUSED)
{
- return (virNetworkFree(network));
+ return (virUnrefNetwork(network));
}
/**
@@ -77,7 +77,7 @@ virNetworkFreeName(virNetworkPtr network, const char *name
ATTRIBUTE_UNUSED)
static int
virStoragePoolFreeName(virStoragePoolPtr pool, const char *name ATTRIBUTE_UNUSED)
{
- return (virStoragePoolFree(pool));
+ return (virUnrefStoragePool(pool));
}
/**
@@ -91,7 +91,7 @@ virStoragePoolFreeName(virStoragePoolPtr pool, const char *name
ATTRIBUTE_UNUSED
static int
virStorageVolFreeName(virStorageVolPtr vol, const char *name ATTRIBUTE_UNUSED)
{
- return (virStorageVolFree(vol));
+ return (virUnrefStorageVol(vol));
}
/**
--
1.6.0.6