Profiler bug in precipitation.cc ?
by Markus Nuebel · in Torque Game Engine · 09/26/2004 (12:50 pm) · 3 replies
The function: destroySplash() may lead to a PROFILE_START() call without a matching PROFILE_END() call, resulting in a stack overflow.
Original code:
Adjustment for matching profiler calls:
The same occurs in processTick():
and in renderPrecip(SceneState *state):
Original code:
void Precipitation::destroySplash(Raindrop *drop)
{
PROFILE_START(PrecipDestroySplash);
if (drop == mSplashHead)
{
mSplashHead = NULL;
[b]return[/b];
}
if (drop->nextSplashDrop)
drop->nextSplashDrop->prevSplashDrop = drop->prevSplashDrop;
if (drop->prevSplashDrop)
drop->prevSplashDrop->nextSplashDrop = drop->nextSplashDrop;
drop->nextSplashDrop = NULL;
drop->prevSplashDrop = NULL;
PROFILE_END();
}Adjustment for matching profiler calls:
void Precipitation::destroySplash(Raindrop *drop)
{
PROFILE_START(PrecipDestroySplash);
if (drop == mSplashHead)
{
mSplashHead = NULL;
}
else
{
if (drop->nextSplashDrop)
drop->nextSplashDrop->prevSplashDrop = drop->prevSplashDrop;
if (drop->prevSplashDrop)
drop->prevSplashDrop->nextSplashDrop = drop->nextSplashDrop;
drop->nextSplashDrop = NULL;
drop->prevSplashDrop = NULL;
}
PROFILE_END();
}The same occurs in processTick():
void Precipitation::processTick(const Move *)
{
...
PROFILE_START(PrecipProcess);
ShapeBase* camObj = conn->getCameraObject();
if (!camObj)
[b]return[/b];
...
PROFILE_END();
}and in renderPrecip(SceneState *state):
void Precipitation::renderPrecip(SceneState *state)
{
PROFILE_START(PrecipRenderPrecip);
GameConnection* conn = GameConnection::getServerConnection();
if (!conn)
[b]return[/b]; //need connection to server
...
PROFILER_END();
} -- MarkusAbout the author
Torque Owner Clint S. Brewer
nothing a couple NICE GOTOS WONT FIX! roxor.