Game Development Community

[beta3 bug] Crash/heap corruption when exiting (GuiTooltipProfile related) [w/fix] - LOGGED

by Manoel Neto · in Torque 3D Professional · 10/14/2010 (5:24 pm) · 5 replies

[EDIT] The bug was a bit different than I found initially[/EDIT]
When you use the same profile for both the GUIControl and its tooltip, a heap corruption will cause a crash when exiting.

To fix this, in sourceguicoreguiControl.cpp, in the function GuiControl::onDeleteNotify(), replace this:
else if (object == mTooltipProfile)
{
  GuiControlProfile* profile;
  Sim::findObject( "GuiDefaultProfile", profile );

  if ( profile == mTooltipProfile )     
	 mTooltipProfile = NULL;
  else
	 setTooltipProfile( profile );
}

By this:
if (object == mTooltipProfile) //<-- CHANGE
{
  GuiControlProfile* profile;
  Sim::findObject( "GuiDefaultProfile", profile );

  if ( profile == mTooltipProfile )     
	 mTooltipProfile = NULL;
  else
	 setTooltipProfile( profile );
}

#1
10/14/2010 (6:03 pm)
Line 4 marked changed however there was no change?
#2
10/14/2010 (10:40 pm)
You got me there: it was the "old" fix. ;)
#3
10/15/2010 (6:48 am)
this fix solve: this thread

Thanks!
#4
10/18/2010 (3:06 pm)
Logged as TQA-1186 for the QA team to verify.
#5
02/26/2011 (9:49 am)
Wow, this lil bastard cost me some time. Thought it was something I did porting to b3. Nope.

Thanks again Manoel for the fix. This needs to make it into the release!