On Tue, 2008-07-08 at 23:52 +0100, Martyn Shaw wrote:
> The new bit in Track *TrackListIterator::RemoveCurrent() has been
> causing me grief and I'm really not sure it's correct. It reads
>
> #ifdef DEBUG_TLI // if we are debugging this bit
> wxASSERT_MSG(((*l).Contains((*cur).t)), wxT("cur invalid after
> deletion of track.")); // check that cur is in the list
> #endif
>
> but I get an error (not assertion) if I delete the last track, as cur
> is not valid, and so I guess (*cur).t is not valid.
Ah, hadn't found that one. The reason I put all those in was because I
was crashing audacity because cur pointed outside the application
address space. My hope is that we will work out how it ends up pointing
there and fix the crashes.
> Is it OK to put
> if(cur)
> wxASSERT_MSG(((*l).Contains((*cur).t)), wxT("cur invalid after
> deletion of track.")); // check that cur
> for this one? I have been using it like that and haven't had any
> errors or assertions.
Better to avoid the if (cur) when asserts are off, hence
wxASSERT_MSG((!cur || (*l).Contains((*cur).t)), wxT("cur invalid after
deletion of track."));
As I used somewhere else for the same reason.
Richard
-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at
http://www.sourceforge.net/community/cca08_______________________________________________
audacity-devel mailing list
audacity-devel@...
https://lists.sourceforge.net/lists/listinfo/audacity-devel