Browse Source

Fixed node allocation memory leaks.

Lasse Öörni 14 years ago
parent
commit
dc136f52b0
3 changed files with 4 additions and 4 deletions
  1. 2 2
      Engine/Container/List.h
  2. 1 1
      Engine/Container/Map.h
  3. 1 1
      Engine/Container/Set.h

+ 2 - 2
Engine/Container/List.h

@@ -118,7 +118,7 @@ public:
         ListBase()
         ListBase()
     {
     {
         // Allocate and link the head and tail nodes
         // Allocate and link the head and tail nodes
-        AllocatorInitialize(sizeof(Node), 2);
+        allocator_ = AllocatorInitialize(sizeof(Node), 2);
         head_ = AllocateNode();
         head_ = AllocateNode();
         tail_ = AllocateNode();
         tail_ = AllocateNode();
         Node* head = GetHead();
         Node* head = GetHead();
@@ -132,7 +132,7 @@ public:
         ListBase()
         ListBase()
     {
     {
         // Allocate and link the head and tail nodes
         // Allocate and link the head and tail nodes
-        AllocatorInitialize(sizeof(Node), list.Size() + 2);
+        allocator_ = AllocatorInitialize(sizeof(Node), list.Size() + 2);
         head_ = AllocateNode();
         head_ = AllocateNode();
         tail_ = AllocateNode();
         tail_ = AllocateNode();
         Node* head = GetHead();
         Node* head = GetHead();

+ 1 - 1
Engine/Container/Map.h

@@ -161,7 +161,7 @@ public:
     /// Construct with another map
     /// Construct with another map
     Map(const Map<T, U>& map)
     Map(const Map<T, U>& map)
     {
     {
-        AllocatorInitialize(sizeof(Node), map.Size());
+        allocator_ = AllocatorInitialize(sizeof(Node), map.Size());
         *this = map;
         *this = map;
     }
     }
     
     

+ 1 - 1
Engine/Container/Set.h

@@ -122,7 +122,7 @@ public:
     /// Construct with another set
     /// Construct with another set
     Set(const Set<T>& set)
     Set(const Set<T>& set)
     {
     {
-        AllocatorInitialize(sizeof(Node), set.Size());
+        allocator_ = AllocatorInitialize(sizeof(Node), set.Size());
         *this = set;
         *this = set;
     }
     }