mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Refactor: use common code to free the list of guids
This commit is contained in:
@@ -1497,14 +1497,9 @@ get_random_guids(int max)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
free_random_guids(GList *guids)
|
free_guids(GList *guids)
|
||||||
{
|
{
|
||||||
GList *node;
|
g_list_free_full (guids, (GDestroyNotify)guid_free);
|
||||||
|
|
||||||
for (node = guids; node; node = node->next)
|
|
||||||
guid_free (static_cast<GncGUID*>(node->data));
|
|
||||||
|
|
||||||
g_list_free (guids);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static QofQueryOp
|
static QofQueryOp
|
||||||
@@ -1671,7 +1666,7 @@ get_random_query(void)
|
|||||||
guids,
|
guids,
|
||||||
compare_param<QofGuidMatch>(QOF_GUID_MATCH_NONE),
|
compare_param<QofGuidMatch>(QOF_GUID_MATCH_NONE),
|
||||||
get_random_queryop ());
|
get_random_queryop ());
|
||||||
free_random_guids (guids);
|
free_guids (guids);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 2: /*PR_ACTION */
|
case 2: /*PR_ACTION */
|
||||||
@@ -2026,9 +2021,7 @@ make_trans_query (Transaction *trans, TestQueryTypes query_types)
|
|||||||
}
|
}
|
||||||
xaccQueryAddAccountGUIDMatch (q, list, QOF_GUID_MATCH_ANY, QOF_QUERY_AND);
|
xaccQueryAddAccountGUIDMatch (q, list, QOF_GUID_MATCH_ANY, QOF_QUERY_AND);
|
||||||
|
|
||||||
for (node = list; node; node = node->next)
|
free_guids (list);
|
||||||
guid_free (static_cast<GncGUID*>(node->data));
|
|
||||||
g_list_free (list);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (query_types & GUID_QT)
|
if (query_types & GUID_QT)
|
||||||
|
|||||||
Reference in New Issue
Block a user