Use prop iterators when needed to retain the obj.

This could explain the strange issues seen in buildbot builds that
have been happening since 0.18; this should fix completely this.
This commit is contained in:
Juan RP
2012-11-30 09:49:09 +01:00
parent 9715d8a6a1
commit b9136c61c9
8 changed files with 87 additions and 50 deletions

View File

@@ -35,12 +35,14 @@ static prop_dictionary_t
get_pkg_in_array(prop_array_t array, const char *str, bool virtual)
{
prop_object_t obj = NULL;
prop_object_iterator_t iter;
const char *pkgver, *dpkgn;
size_t i;
bool found = false;
for (i = 0; i < prop_array_count(array); i++) {
obj = prop_array_get(array, i);
iter = prop_array_iterator(array);
assert(iter);
while ((obj = prop_object_iterator_next(iter))) {
if (virtual) {
/*
* Check if package pattern matches
@@ -82,6 +84,8 @@ get_pkg_in_array(prop_array_t array, const char *str, bool virtual)
}
}
}
prop_object_iterator_release(iter);
return found ? obj : NULL;
}