fix issue 184. clean up xcode project.
This commit is contained in:
24
tinyxml2.h
24
tinyxml2.h
@@ -122,9 +122,9 @@ inline int TIXML_SNPRINTF( char* buffer, size_t size, const char* format, ... )
|
||||
/* 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 @@ public:
|
||||
return _mem[i];
|
||||
}
|
||||
|
||||
const T& PeekTop() const {
|
||||
const T& PeekTop() const {
|
||||
TIXMLASSERT( _size > 0 );
|
||||
return _mem[ _size - 1];
|
||||
}
|
||||
@@ -317,6 +317,7 @@ public:
|
||||
virtual void* Alloc() = 0;
|
||||
virtual void Free( void* ) = 0;
|
||||
virtual void SetTracked() = 0;
|
||||
virtual void Clear() = 0;
|
||||
};
|
||||
|
||||
|
||||
@@ -329,10 +330,20 @@ class MemPoolT : public MemPool
|
||||
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 @@ public:
|
||||
_nUntracked++;
|
||||
return result;
|
||||
}
|
||||
|
||||
virtual void Free( void* mem ) {
|
||||
if ( !mem ) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user