From: <tz...@us...> - 2006-10-14 22:19:56
|
Revision: 1907 http://svn.sourceforge.net/freeorion/revision/?rev=1907&view=rev Author: tzlaine Date: 2006-10-14 15:19:52 -0700 (Sat, 14 Oct 2006) Log Message: ----------- This is the final fix to the bug supposedly fixed by 1902. It appears that the problem was that Boost signals are calling member functions of deleted objects, even though those objects were derived from boost::signals::trackable. The fix was to add manual connection management to SidePanel::PlanetPanel. Modified Paths: -------------- trunk/FreeOrion/UI/SidePanel.cpp Modified: trunk/FreeOrion/UI/SidePanel.cpp =================================================================== --- trunk/FreeOrion/UI/SidePanel.cpp 2006-10-14 20:50:42 UTC (rev 1906) +++ trunk/FreeOrion/UI/SidePanel.cpp 2006-10-14 22:19:52 UTC (rev 1907) @@ -778,9 +778,15 @@ SidePanel::PlanetPanel::~PlanetPanel() { - for(unsigned int i=0;i<m_vec_unused_controls.size();i++) - delete m_vec_unused_controls[i]; - m_vec_unused_controls.clear(); + // HACK! These disconnects should not be necessary, since PlanetPanel is derived from boost::signals::trackable, but + // a segfault occurrs if they are not done (as of Boost 1.33.1). + m_connection_system_changed.disconnect(); + m_connection_planet_changed.disconnect(); + m_connection_planet_production_changed.disconnect(); + + for(unsigned int i=0;i<m_vec_unused_controls.size();i++) + delete m_vec_unused_controls[i]; + m_vec_unused_controls.clear(); } Planet* SidePanel::PlanetPanel::GetPlanet() |