Hi,
I use readline in my application, and valgrind detected leaks even
if i use clear_history().
There's comment in this function:
/* This loses because we cannot free the data. */
So I tried with remove_history, such thing:
int i;
while ((i = history_length)) {
printf("%d\n", history_length);
HIST_ENTRY *rm = remove_history(i);
free_history_entry(rm);
free(rm);
}
And this causes an endless loop,
history_length doesn't get decremented, although it obviously does
in remove_history function after renumbering loop.
I'm confused, any feedback appreciated.
Jalil
_______________________________________________
Bug-readline mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-readline
[Bug-readline] history cleanup question
Jalil Karimov <[email protected]> Sun, 29 Jan 2012 07:25:22 -0800
- [Bug-readline] history cleanup q... Jalil Karimov <[email protected]>
- Re: [Bug-readline] history ... Chet Ramey
- Re: [Bug-readline] hist... Jalil Karimov <[email protected]>
- Re: [Bug-readline] ... Chet Ramey
