summaryrefslogtreecommitdiff
path: root/library/DataDefs.cpp
diff options
context:
space:
mode:
authorAlexander Gavrilov2012-08-26 13:23:59 +0400
committerAlexander Gavrilov2012-08-26 14:43:14 +0400
commit7f1e4b46bc102014533c015f09a20eef38aab13c (patch)
tree8ba3066af58ccaa4c3d0b84fd87ef3b6e03fae31 /library/DataDefs.cpp
parentf6e4969e1988422f854989fdde85a8b691d64c73 (diff)
downloaddfhack-7f1e4b46bc102014533c015f09a20eef38aab13c.tar.gz
dfhack-7f1e4b46bc102014533c015f09a20eef38aab13c.tar.bz2
dfhack-7f1e4b46bc102014533c015f09a20eef38aab13c.tar.xz
Implement inheritance-aware vmethod interposing.
I.e. overwriting the vmethod in all vtables that use it, not only one.
Diffstat (limited to 'library/DataDefs.cpp')
-rw-r--r--library/DataDefs.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/library/DataDefs.cpp b/library/DataDefs.cpp
index d6604cdb..4428a2f7 100644
--- a/library/DataDefs.cpp
+++ b/library/DataDefs.cpp
@@ -218,8 +218,8 @@ 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
- for (int i = interpose_list.size()-1; i >= 0; i--)
- interpose_list[i]->remove();
+ while (!interpose_list.empty())
+ interpose_list.begin()->second->on_host_delete(this);
}
/* Vtable name to identity lookup. */