On Tue, Sep 26, 2000 at 11:45:12PM -0400, Isaac Richards wrote:
> Um.  That's the desired behaviour, else there's going to be a mem leak.  the
> 'meta' in this instance is a local variable -- why set it to null when the
> function returns a line later?  If you're having problems with this, I'd say
> it's because you changed the MetaData class so that it needs an explicit copy
> constructor...

Oh...the extra return statements..okay.

And of course meta has a new explicit copy constructor and assignment operator.
It has to unref the old string (if any) and reference the new string.

I had the music browser up and with edit info seeming to work, but now
I made a few "improvements" and I have more segfaults in the way to
clear out.

after loading, it prints out a report:

HashStore report
Logical Strings held: 11979
Empty String count: 9660
Strings in HSet: 0
Strings in HMap: 1156
Strings marked in KList: 0

So have 9660 string allocation totally avoided.  They are all the same
char * value.

And I have 11979-9660=2319 other references.  But the char* are
all in HMap, so each had at least 2 ref's at one point.
(When added they are in HSet, when ++refcount they move to HMap, but
when --refcount they stay in HMap).

Freeamp is playing right now...But opening the music browser causes a segfault.
Ah..found the cause...compiling...

> 
> Isaac 
> 
> On 27-Sep-2000 Chris Kuklewicz wrote:
> > First: WARNING the function 
> > 
> > Error MusicCatalog::AddSong(const char *url)
> > 
> > says "delete meta;" inside and after the look... twice...segfault
> > 
> > STRONG SUGGESTION : after a call to delete set the pointer to NULL.
> > Only exception is if it is manifestly obvious from looking at the
> > screen that it cannot possibly screw up.  (like a two line function).
> > 
> > Setting meta=NULL after a delete prevents this problem here.
_______________________________________________
[EMAIL PROTECTED]
http://www.freeamp.org/mailman/listinfo/freeamp-dev

Reply via email to