fix issue 184. clean up xcode project.
diff --git a/tinyxml2.h b/tinyxml2.h
index 4dfb015..5f8bfcd 100755
--- a/tinyxml2.h
+++ b/tinyxml2.h
@@ -122,9 +122,9 @@
/* Versioning, past 1.0.14:
http://semver.org/
*/
-static const int TIXML2_MAJOR_VERSION = 2;
-static const int TIXML2_MINOR_VERSION = 2;
-static const int TIXML2_PATCH_VERSION = 0;
+static const int TIXML2_MAJOR_VERSION = 2;
+static const int TIXML2_MINOR_VERSION = 2;
+static const int TIXML2_PATCH_VERSION = 0;
namespace tinyxml2
{
@@ -261,7 +261,7 @@
return _mem[i];
}
- const T& PeekTop() const {
+ const T& PeekTop() const {
TIXMLASSERT( _size > 0 );
return _mem[ _size - 1];
}
@@ -317,6 +317,7 @@
virtual void* Alloc() = 0;
virtual void Free( void* ) = 0;
virtual void SetTracked() = 0;
+ virtual void Clear() = 0;
};
@@ -329,10 +330,20 @@
public:
MemPoolT() : _root(0), _currentAllocs(0), _nAllocs(0), _maxAllocs(0), _nUntracked(0) {}
~MemPoolT() {
+ Clear();
+ }
+
+ void Clear() {
// Delete the blocks.
- for( int i=0; i<_blockPtrs.Size(); ++i ) {
- delete _blockPtrs[i];
+ while( !_blockPtrs.Empty()) {
+ Block* b = _blockPtrs.Pop();
+ delete b;
}
+ _root = 0;
+ _currentAllocs = 0;
+ _nAllocs = 0;
+ _maxAllocs = 0;
+ _nUntracked = 0;
}
virtual int ItemSize() const {
@@ -365,6 +376,7 @@
_nUntracked++;
return result;
}
+
virtual void Free( void* mem ) {
if ( !mem ) {
return;