Fix hypopg_reset() function.

Previously, the entries wasn't remove in hypo_entry_remove() due to forgotten
lfirst() calll, leading to memory leak in the backend's TopMemoryContext. The
loop was also wrong, also fixed.
This commit is contained in:
Julien Rouhaud 2015-08-31 17:19:33 +02:00
parent 8ad1e60bfc
commit ca1044d00a

View file

@ -423,9 +423,13 @@ hypo_entry_reset(void)
{
ListCell *lc;
foreach(lc, entries)
/*
* The cell is removed in hypo_entry_remove(), so we can't iterate using
* standard foreach / lnext macros.
*/
while ((lc = list_head(entries)) != NULL)
{
hypoEntry *entry = (hypoEntry *) lc;
hypoEntry *entry = (hypoEntry *) lfirst(lc);
hypo_entry_remove(entry->oid);
}