Game Development Community

Torque 3D Beta 5 Bug - Popup calls deleted object parent fn [+fix]

by Konrad Kiss · in Torque 3D Professional · 08/13/2009 (2:56 pm) · 5 replies

I think I found something interesting:

guiPopUpCtrl.cpp:
void GuiPopupTextListCtrl::onMouseUp(const GuiEvent &event)
{
   Parent::onMouseDown(event);
   mPopUpCtrl->closePopUp();
   Parent::onMouseUp(event);
}

closePopUp() will destroy the text list control that belongs to the popup. When it returns (and it does return), it calls Parent::onMouseUp(event) which would break guiControl's virtual onMouseUp with an uninitialized this if there was anything using the current object in there.

I think our best bet is getting rid of that Parent::onMouseUp(event); all together.
(I know GuiControl::onMouseUp is virtual for a reason, just saying. :)

#1
08/17/2009 (6:23 pm)
Logged as THREED-667
#2
10/31/2009 (7:28 pm)
Has this been looked at yet?
#3
11/02/2009 (8:56 pm)
I think it's still wrong in 1.0.1.
#4
11/03/2009 (8:50 am)

Yep, it is. Thanks for reporting this, Konrad.

Fix merged for 1.1.
#5
11/03/2009 (8:52 am)
Awesome, thanks Rene.