draw: squash a couple of memory leaks
authorKeith Whitwell <keith@tungstengraphics.com>
Mon, 21 Apr 2008 20:01:38 +0000 (21:01 +0100)
committerKeith Whitwell <keith@tungstengraphics.com>
Mon, 21 Apr 2008 20:01:38 +0000 (21:01 +0100)
src/gallium/auxiliary/draw/draw_pt_fetch.c
src/gallium/auxiliary/draw/draw_pt_fetch_emit.c

index c588710b756f889f8da26b74269431b9553da489..f98bce6eac0a2999891eebaa6af043bf96e9adb4 100644 (file)
@@ -166,6 +166,9 @@ struct pt_fetch *draw_pt_fetch_create( struct draw_context *draw )
 
 void draw_pt_fetch_destroy( struct pt_fetch *fetch )
 {
+   if (fetch->translate)
+      fetch->translate->release( fetch->translate );
+
    FREE(fetch);
 }
 
index 7735173042b7465af3ce38e2a5ed8579c938e967..68b2c5b1e3d0f5893835483b9bd8ddba29044045 100644 (file)
@@ -264,6 +264,11 @@ static void fetch_emit_finish( struct draw_pt_middle_end *middle )
 
 static void fetch_emit_destroy( struct draw_pt_middle_end *middle )
 {
+   struct fetch_emit_middle_end *feme = (struct fetch_emit_middle_end *)middle;
+
+   if (feme->translate)
+      feme->translate->release( feme->translate );
+   
    FREE(middle);
 }