On Sun, May 25, 2008 at 09:31:30AM -0400, Jorge Arellano Cid wrote:
Hi Jeremy,
Nav_stack_truncate() and Nav_stack_insert() are ad-hoc bindings. They're called just in one place of the code. They're not clean well-defined functions of an ADT.
This is "your" mistake. :-)
I'll cheerfully abandon my expectations of consistency. :-) But what about memory[1]? Doesn't it leak when Nav_stack_truncate() shrinks bw->nav_stack ? It seems to me that Nav_stack_truncate() should free all those pointers (and therefore Nav_stack_insert() shouldn't free anything). I'll supply a patch if you agree.
The nav.c module is asking for a clean ADT, and if you can work on it, it's certainly welcomed.
Then I hope people will review the patch I sent to the discussion with corvid about the Redirect/Reload crash bug, which is all about the handling of the navigation stack.
BTW, if it's to be rewritten it'd be good to have the TABs interface in mind.
Oh noes, you have spotted my hidden agenda! :-) I was indeed thinking that if I got my head around this it would prepare me for looking at tabs.
This is, if we end with a clean ADT or object, we could have an array of them, one for each tab, and switch freely among navigation stacks.
As a first step, maybe we could modify uicmd.cc to indirect though a new BrowserWindowSet object. The callbacks would be changed to look up the current BrowserWindow of the BrowserWindowSet . Initially the BrowserWindowSet could be a stub that managed a single BrowserWindow , later it could wrap an array of BrowserWindows . Regards, Jeremy Henty [1] Dillo's memory, that is, not mine. I'm afraid fixing Dillo's memory leaks is easier than fixing my own!