mirror of
https://github.com/HypoPG/hypopg
synced 2026-05-24 09:38:21 +00:00
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:
parent
8ad1e60bfc
commit
ca1044d00a
1 changed files with 6 additions and 2 deletions
8
hypopg.c
8
hypopg.c
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue