Clearing up some memory to prevent stupid issues
Preparing for some optimisations. (absolutely need to reduce the ammount of allocations done.)
This commit is contained in:
@@ -21,6 +21,7 @@ private:
|
||||
public:
|
||||
Intersect();
|
||||
~Intersect();
|
||||
void reset();
|
||||
void add(Intersection i);
|
||||
int count() { return this->num; };
|
||||
Intersection operator[](const int p) { return *this->list[p]; }
|
||||
|
||||
@@ -31,6 +31,14 @@ public:
|
||||
if (p == nullptr) { return; }
|
||||
|
||||
/* clear up the list */
|
||||
do
|
||||
{
|
||||
ChainList *next = p->next;
|
||||
free(p);
|
||||
p = next;
|
||||
}
|
||||
while(p != nullptr);
|
||||
|
||||
}
|
||||
|
||||
Shape *last()
|
||||
|
||||
Reference in New Issue
Block a user