Explorar o código

port r17373 from 1.2: fix yet more memory leak

Samuel Thibault %!s(int64=9) %!d(string=hai) anos
pai
achega
5a3b928027
Modificáronse 1 ficheiros con 18 adicións e 5 borrados
  1. 18 5
      src/top/starpu_top.c

+ 18 - 5
src/top/starpu_top.c

@@ -222,11 +222,24 @@ void starpu_top_init_and_wait(const char* server_name)
 
 void _starpu_top_shutdown(void)
 {
-	struct starpu_top_data * cur = starpu_top_first_data, * next;
-	while (cur) {
-		next = cur->next;
-		free(cur);
-		cur = next;
+	{
+		struct starpu_top_data * cur = starpu_top_first_data, * next;
+		while (cur) {
+			next = cur->next;
+			free(cur);
+			cur = next;
+		}
+		starpu_top_first_data = NULL;
+	}
+
+	{
+		struct starpu_top_param * cur = starpu_top_first_param, *next;
+		while (cur) {
+			next = cur->next;
+			free(cur);
+			cur = next;
+		}
+		starpu_top_first_param = NULL;
 	}
 }