gtkradiant/plugins/entity
Alex Lo fcefc8b9de Fix crash when deleting a misc_model
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.
2015-07-21 00:08:31 +01:00
..
eclassmodel.cpp uncrustify! now the code is only ugly on the *inside* 2012-03-17 15:01:54 -05:00
entity.cpp Fix crash when deleting a misc_model 2015-07-21 00:08:31 +01:00
entity.def rebuilt gtk binary dependencies file 2010-12-13 04:21:05 +00:00
entity.h uncrustify! now the code is only ugly on the *inside* 2012-03-17 15:01:54 -05:00
entity.vcproj 8MB stack size linker options on all VC2008 proj files. 2011-04-06 04:12:34 +00:00
entity.vcxproj switch to xp compatible compiler toolchain, add/fix an archive and upload script for the VM builder 2013-08-24 22:50:12 +00:00
entity.vcxproj.filters convert projects to msvc 2012 2013-05-23 20:44:41 -05:00
entity_entitymodel.cpp uncrustify! now the code is only ugly on the *inside* 2012-03-17 15:01:54 -05:00
entity_entitymodel.h uncrustify! now the code is only ugly on the *inside* 2012-03-17 15:01:54 -05:00
light.cpp add license info on a few things 2012-06-04 23:42:31 -05:00
light.h uncrustify! now the code is only ugly on the *inside* 2012-03-17 15:01:54 -05:00
miscmodel.cpp uncrustify! now the code is only ugly on the *inside* 2012-03-17 15:01:54 -05:00
plugin.cpp uncrustify! now the code is only ugly on the *inside* 2012-03-17 15:01:54 -05:00
plugin.h uncrustify! now the code is only ugly on the *inside* 2012-03-17 15:01:54 -05:00