summaryrefslogtreecommitdiff
path: root/library/DataDefs.cpp
diff options
context:
space:
mode:
authorAlexander Gavrilov2012-08-26 22:43:18 +0400
committerAlexander Gavrilov2012-08-26 22:43:18 +0400
commitb2bdc199cb6aec64034e672f7590aa2a7a27194c (patch)
tree825af130e3c0bb313e3699099836e3acfafe7626 /library/DataDefs.cpp
parent84f6663a078ee8907fb1287fc25672c5f226f420 (diff)
downloaddfhack-b2bdc199cb6aec64034e672f7590aa2a7a27194c.tar.gz
dfhack-b2bdc199cb6aec64034e672f7590aa2a7a27194c.tar.bz2
dfhack-b2bdc199cb6aec64034e672f7590aa2a7a27194c.tar.xz
Fix NULL pointer access in ~virtual_identity.
Diffstat (limited to 'library/DataDefs.cpp')
-rw-r--r--library/DataDefs.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/library/DataDefs.cpp b/library/DataDefs.cpp
index 4428a2f7..34116444 100644
--- a/library/DataDefs.cpp
+++ b/library/DataDefs.cpp
@@ -218,8 +218,10 @@ virtual_identity::virtual_identity(size_t size, TAllocateFn alloc,
virtual_identity::~virtual_identity()
{
// Remove interpose entries, so that they don't try accessing this object later
- while (!interpose_list.empty())
- interpose_list.begin()->second->on_host_delete(this);
+ for (auto it = interpose_list.begin(); it != interpose_list.end(); ++it)
+ if (it->second)
+ it->second->on_host_delete(this);
+ interpose_list.clear();
}
/* Vtable name to identity lookup. */