Paul Snively
2000-04-03 01:10:14 UTC
Folks,
I finally checked out CS and began looking at it in earnest. In so doing,
I've discovered a few places where the classic C++ error of not matching
your news to your deletes and your new[]s to your delete[]s occur.
In csSoundData::Clean():
CHKB (delete (UByte *)Data);
needs to be:
CHKB (delete[] (UByte *)Data);
In csSpriteTemplate::ComputeNormals():
CHK (delete tri_normals);
needs to be:
CHK (delete[] tri_normals);
In csVFS::~csVFS():
CHK (delete cwd);
needs to be:
CHK (delete[] cwd);
In the Blocks application, HighScore::~HighScore():
delete names[i];
needs to be:
delete[] names[i];
So far, these four instances are all I've found, but collectively they
resolve serious crashing bugs in Blocks and Walktest. I've observed other
bugs (halos in Mac OpenGL are black rather than white, as is text; in
Walktest using flarge.zip and the software renderer, the revolving conjoined
circular wood-textured items show a "rainbow" effect at the edges at certain
points in their rotation), but those aren't system crashers, whereas the
above-mentioned incorrect C++ definitely is.
Anyway, I'm having fun with my initial digging--thanks for a great tool!
Oh, BTW: if I want to try my hand at integrating CS into Java using JNI,
where would I start? Anyone else already looking at this?
Best regards,
Paul Snively
I finally checked out CS and began looking at it in earnest. In so doing,
I've discovered a few places where the classic C++ error of not matching
your news to your deletes and your new[]s to your delete[]s occur.
In csSoundData::Clean():
CHKB (delete (UByte *)Data);
needs to be:
CHKB (delete[] (UByte *)Data);
In csSpriteTemplate::ComputeNormals():
CHK (delete tri_normals);
needs to be:
CHK (delete[] tri_normals);
In csVFS::~csVFS():
CHK (delete cwd);
needs to be:
CHK (delete[] cwd);
In the Blocks application, HighScore::~HighScore():
delete names[i];
needs to be:
delete[] names[i];
So far, these four instances are all I've found, but collectively they
resolve serious crashing bugs in Blocks and Walktest. I've observed other
bugs (halos in Mac OpenGL are black rather than white, as is text; in
Walktest using flarge.zip and the software renderer, the revolving conjoined
circular wood-textured items show a "rainbow" effect at the edges at certain
points in their rotation), but those aren't system crashers, whereas the
above-mentioned incorrect C++ definitely is.
Anyway, I'm having fun with my initial digging--thanks for a great tool!
Oh, BTW: if I want to try my hand at integrating CS into Java using JNI,
where would I start? Anyone else already looking at this?
Best regards,
Paul Snively