r300g: fix context destroy under hyperz
authorDave Airlie <airlied@redhat.com>
Tue, 17 Aug 2010 09:01:18 +0000 (19:01 +1000)
committerDave Airlie <airlied@redhat.com>
Tue, 17 Aug 2010 09:01:18 +0000 (19:01 +1000)
we were destroying the mm before unrefing all the objects, so segfault.

Signed-off-by: Dave Airlie <airlied@redhat.com>
src/gallium/drivers/r300/r300_context.c

index a83ad892eaa28e0bd66b39fe06b58edbe745c623..852d88af543a31559af3e3ddfb632456f833c88a 100644 (file)
@@ -119,15 +119,15 @@ static void r300_destroy_context(struct pipe_context* context)
     if (r300->upload_ib)
         u_upload_destroy(r300->upload_ib);
 
-    if (r300->zmask_mm)
-        r300_hyperz_destroy_mm(r300);
-
     if (r300->tran.translate_cache)
         translate_cache_destroy(r300->tran.translate_cache);
 
     /* XXX: This function assumes r300->query_list was initialized */
     r300_release_referenced_objects(r300);
 
+    if (r300->zmask_mm)
+        r300_hyperz_destroy_mm(r300);
+
     if (r300->cs)
         r300->rws->cs_destroy(r300->cs);