mirror of
https://github.com/TTimo/GtkRadiant.git
synced 2024-11-10 07:11:54 +00:00
fcefc8b9de
The following sequence of events and conditions will cause a segfault to occur: 1. Delete a misc_model 2. Undo the delete 3. Delete the same model again 4. Undo the delete A segfault will occur in CEntityMiscModel::Draw when m_model is dereferenced as it has been deleted and cleared. When cloning the misc_model entity, a new CEntityMiscModel is created and the name is set. However, CEntityMiscModel::BuildCacheRequestString relies on all epairs to be present before being able to generate the *correct* request string for the misc_model. Not doing so will cause incorrect behaviour - in this case, the reference count for the CEntityMiscModel is decremented one too many times and causes the object to be deleted. The misc_model object is then used later on after it has been freed. This commit fixes the problem by copying all epairs, before firing the OnKeyValueChanged events. This way, all epairs will be available when BuildCacheRequestString is called. |
||
---|---|---|
.. | ||
eclassmodel.cpp | ||
entity.cpp | ||
entity.def | ||
entity.h | ||
entity.vcproj | ||
entity.vcxproj | ||
entity.vcxproj.filters | ||
entity_entitymodel.cpp | ||
entity_entitymodel.h | ||
light.cpp | ||
light.h | ||
miscmodel.cpp | ||
plugin.cpp | ||
plugin.h |