|
From: Matt K. <ra...@ch...> - 2004-03-26 02:40:14
|
Matt Kelly wrote:
> Perhaps this is a tad premature, but:
>
> Every time I run the latest and greatest build of JAZZ, when I perform
> a File -> Exit, it dumps core.
>
Replying to my own post... I found the source of the valgrind
complaints. Bad use of 'delete'.
In events.h:
Line 546-ish:
virtual ~tMetaEvent()
{
delete [] Data;
}
In track.cpp:
diff -r1.4 track.cpp
1111,1116c1111,1116
< tJazzMeta jazz;
< jazz.SetAudioMode(audio_mode);
< jazz.SetTrackState(State);
< jazz.SetTrackDevice(Device);
< jazz.SetIntroLength(TheSong->GetIntroLength());
< jazz.Write(io);
---
> tJazzMeta *jazz = new tJazzMeta;
> jazz->SetAudioMode(audio_mode);
> jazz->SetTrackState(State);
> jazz->SetTrackDevice(Device);
> jazz->SetIntroLength(TheSong->GetIntroLength());
> jazz->Write(io);
In jazz.cpp -- the first one is in function
tConfigEntry::~tConfigEntry(), and the second one is in
tConfig::~tConfig():
diff -r1.6 jazz.cpp
101c101,102
< delete StrValue;
---
> if (StrValue)
> delete [] StrValue;
274c275,276
< delete [] Names[i];
---
> if (Names[i])
> delete Names[i];
Please apply these to the sources.
Maybe I should have write access to the repository?
Matt
|