- avoid losing pointer to the next bezier patch while freeing the current one (CID...
authorKamil Hornicek <kamil.hornicek@reactos.org>
Fri, 21 Nov 2008 15:01:01 +0000 (15:01 +0000)
committerKamil Hornicek <kamil.hornicek@reactos.org>
Fri, 21 Nov 2008 15:01:01 +0000 (15:01 +0000)
svn path=/trunk/; revision=37514

reactos/dll/win32/glu32/libnurbs/interface/bezierPatch.cc

index de9d4dc..e9ffbb7 100644 (file)
@@ -111,8 +111,13 @@ void bezierPatchDelete(bezierPatch *b)
 void bezierPatchDeleteList(bezierPatch *b)
 {
   bezierPatch *temp;
-  for(temp = b; temp != NULL; temp = temp->next)
-    bezierPatchDelete(temp);
+
+  while(b != NULL)
+  {
+    temp = b->next;
+    bezierPatchDelete(b);
+    b = temp;
+  }
 }
 
 bezierPatch* bezierPatchInsert(bezierPatch *list, bezierPatch *b)