gtkradiant/plugins
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
..
eclassfgd 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 Fix crash when deleting a misc_model 2015-07-21 00:08:31 +01:00
image use g_malloc and g_free everywhere - causes Windows only crashes 2013-09-14 15:46:37 -05:00
imagehl 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
imagem8 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
imagepng 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
imagewal 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
map 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
mapxml 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
model 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
sample uncrustify! now the code is only ugly on the *inside* 2012-03-17 15:01:54 -05:00
shaders 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
spritemodel 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
surface wtf. better 2013-11-26 16:11:55 -06:00
surface_idtech2 Enable decimal precision for texture rotation in idTech2 surface dialog. 2013-11-19 21:30:28 -05:00
textool 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
vfspak use g_malloc and g_free everywhere - causes Windows only crashes 2013-09-14 15:46:37 -05:00
vfspk3 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
vfsqlpk3 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
vfswad vfswad: lowercase the wad name at load time, because queries from map/parse.cpp come in as lowercase 2015-05-26 21:23:29 -06:00