浏览代码

test: plug leaks of testmouse and testrwlock

Anonymous Maarten 3 周之前
父节点
当前提交
17a891daa8
共有 2 个文件被更改,包括 6 次插入0 次删除
  1. 5 0
      test/testmouse.c
  2. 1 0
      test/testrwlock.c

+ 5 - 0
test/testmouse.c

@@ -345,6 +345,11 @@ int main(int argc, char *argv[])
     }
 #endif
 
+    while (active) {
+        Object *next = active->next;
+        SDL_free(next);
+        active = next;
+    }
     SDL_DestroyRenderer(loop_data.renderer);
     SDL_DestroyWindow(window);
 

+ 1 - 0
test/testrwlock.c

@@ -166,6 +166,7 @@ int main(int argc, char *argv[])
     for (i = 0; i < nb_threads; ++i) {
         SDL_WaitThread(threads[i], NULL);
     }
+    SDL_free(threads);
 
     SDL_Log("Reader threads have terminated, quitting!");
     SDL_DestroyRWLock(rwlock);