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:
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. :)
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. :)
About the author
http://about.me/konrad.kiss
Torque 3D Owner Kenneth Holst
Default Studio Name