summaryrefslogtreecommitdiff
path: root/indra/llcommon/llheteromap.cpp
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2016-10-12 23:01:48 -0400
committerNat Goodspeed <nat@lindenlab.com>2016-10-12 23:01:48 -0400
commit763509589dc9933d04a26e8109f90591eef1d012 (patch)
treeb74614fa4933e02ecee3f0f6466dd4799cead0e7 /indra/llcommon/llheteromap.cpp
parent704c53b3c506c1274981b3e1ca5a22c16e4fbbb4 (diff)
MAINT-5232: Add LLHeteroMap to contain objects of unrelated classes.
Diffstat (limited to 'indra/llcommon/llheteromap.cpp')
-rw-r--r--indra/llcommon/llheteromap.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/indra/llcommon/llheteromap.cpp b/indra/llcommon/llheteromap.cpp
new file mode 100644
index 0000000000..7c19196e0c
--- /dev/null
+++ b/indra/llcommon/llheteromap.cpp
@@ -0,0 +1,32 @@
+/**
+ * @file llheteromap.cpp
+ * @author Nat Goodspeed
+ * @date 2016-10-12
+ * @brief Implementation for llheteromap.
+ *
+ * $LicenseInfo:firstyear=2016&license=viewerlgpl$
+ * Copyright (c) 2016, Linden Research, Inc.
+ * $/LicenseInfo$
+ */
+
+// Precompiled header
+#include "linden_common.h"
+// associated header
+#include "llheteromap.h"
+// STL headers
+// std headers
+// external library headers
+// other Linden headers
+
+LLHeteroMap::~LLHeteroMap()
+{
+ // For each entry in our map, we must call its deleter, which is the only
+ // record we have of its original type.
+ for (TypeMap::iterator mi(mMap.begin()), me(mMap.end()); mi != me; ++mi)
+ {
+ // mi->second is the std::pair; mi->second.first is the void*;
+ // mi->second.second points to the deleter function
+ (mi->second.second)(mi->second.first);
+ mi->second.first = NULL;
+ }
+}