nv50/nv40/nv30: fix small memory leak of nouveau_resources on screen_destroy
authorMarcin Slusarz <marcin.slusarz@gmail.com>
Tue, 12 Jan 2010 14:41:50 +0000 (15:41 +0100)
committerFrancisco Jerez <currojerez@riseup.net>
Mon, 1 Feb 2010 00:28:06 +0000 (01:28 +0100)
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
src/gallium/drivers/nv30/nv30_screen.c
src/gallium/drivers/nv40/nv40_screen.c
src/gallium/drivers/nv50/nv50_screen.c

index ee83ec56760114031890beaf84867791fdaeeac2..62ee2e7697aa0374dfde7ea04c4b4586c77da15a 100644 (file)
@@ -173,9 +173,9 @@ nv30_screen_destroy(struct pipe_screen *pscreen)
                        so_ref(NULL, &screen->state[i]);
        }
 
-       nouveau_resource_free(&screen->vp_exec_heap);
-       nouveau_resource_free(&screen->vp_data_heap);
-       nouveau_resource_free(&screen->query_heap);
+       nouveau_resource_destroy(&screen->vp_exec_heap);
+       nouveau_resource_destroy(&screen->vp_data_heap);
+       nouveau_resource_destroy(&screen->query_heap);
        nouveau_notifier_free(&screen->query);
        nouveau_notifier_free(&screen->sync);
        nouveau_grobj_free(&screen->rankine);
index b1a7343b409e908ec7a249330706b1f2912fec88..56fb80975cc989a924a2be50ba7486dca28e40ff 100644 (file)
@@ -157,9 +157,9 @@ nv40_screen_destroy(struct pipe_screen *pscreen)
                        so_ref(NULL, &screen->state[i]);
        }
 
-       nouveau_resource_free(&screen->vp_exec_heap);
-       nouveau_resource_free(&screen->vp_data_heap);
-       nouveau_resource_free(&screen->query_heap);
+       nouveau_resource_destroy(&screen->vp_exec_heap);
+       nouveau_resource_destroy(&screen->vp_data_heap);
+       nouveau_resource_destroy(&screen->query_heap);
        nouveau_notifier_free(&screen->query);
        nouveau_notifier_free(&screen->sync);
        nouveau_grobj_free(&screen->curie);
index c4465a228ca95a95d725fe9805a917ccb0313e51..48c7b19584ff12a29365b4a5109952bdc6882d4b 100644 (file)
@@ -195,6 +195,9 @@ nv50_screen_destroy(struct pipe_screen *pscreen)
        nouveau_grobj_free(&screen->tesla);
        nouveau_grobj_free(&screen->eng2d);
        nouveau_grobj_free(&screen->m2mf);
+       nouveau_resource_destroy(&screen->immd_heap[0]);
+       nouveau_resource_destroy(&screen->parm_heap[0]);
+       nouveau_resource_destroy(&screen->parm_heap[1]);
        nouveau_screen_fini(&screen->base);
        FREE(screen);
 }