dbertoni 2004/10/21 16:48:27
Modified: c/src/xalanc/Include XalanMap.hpp
Log:
Better work-around for VC++ 6.0 bug. Temporary fix for bug where entries
were not destroyed and de-allocated in clear() and in the destructor.
Revision Changes Path
1.15 +20 -3 xml-xalan/c/src/xalanc/Include/XalanMap.hpp
Index: XalanMap.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/Include/XalanMap.hpp,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- XalanMap.hpp 20 Oct 2004 21:29:09 -0000 1.14
+++ XalanMap.hpp 21 Oct 2004 23:48:27 -0000 1.15
@@ -268,6 +268,7 @@
~XalanMap()
{
+ doRemoveEntries();
}
XalanMap & operator=(const XalanMap& theRhs)
@@ -282,7 +283,8 @@
return m_size;
}
- bool empty() const {
+ bool empty() const
+ {
return m_size == 0;
}
@@ -390,6 +392,8 @@
void clear()
{
+ doRemoveEntries();
+
m_size = 0;
XALAN_STD_QUALIFIER fill(
@@ -453,7 +457,7 @@
return bucketStartPos;
}
- void doRemoveEntry(iterator & toRemovePos)
+ void doRemoveEntry(const iterator & toRemovePos)
{
size_type index = toRemovePos->bucketIndex;
iterator nextPos = ++(iterator(toRemovePos));
@@ -473,13 +477,26 @@
m_buckets[index] = m_entries.end();
}
}
-
+
value_type& toRemove = *toRemovePos;
+#if defined(_MSC_VER) && _MSC_VER <= 1300
toRemove.value_type::~value_type();
+#else
+ toRemove.~value_type();
+#endif
deallocate(&toRemove);
m_entries.erase(toRemovePos);
--m_size;
}
+
+ void
+ doRemoveEntries()
+ {
+ while(size() > 0)
+ {
+ doRemoveEntry(begin());
+ }
+ }
size_type doHash(const Key & key) const
{
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]