Explorar o código

Fix my own stupidity.

Godzil %!s(int64=4) %!d(string=hai) anos
pai
achega
1cebcd4f8b
Modificáronse 1 ficheiros con 5 adicións e 2 borrados
  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()