Browse Source

Fix my own stupidity.

Godzil 4 years ago
parent
commit
1cebcd4f8b
1 changed files with 5 additions and 2 deletions
  1. 5 2
      source/intersect.cpp

+ 5 - 2
source/intersect.cpp

@@ -34,10 +34,13 @@ Intersect::~Intersect()
     int i;
     for(i = 0; i < this->num; i++)
     {
-        free(this->list[i]);
+        delete this->list[i];
     }
     /* Free stuff */
-    free(this->list);
+    if (this->list != nullptr)
+    {
+        free(this->list);
+    }
 }
 
 void Intersect::reset()