draw: free more token arrays
authorKeith Whitwell <keithw@vmware.com>
Tue, 2 Jun 2009 03:15:28 +0000 (20:15 -0700)
committerKeith Whitwell <keithw@vmware.com>
Tue, 2 Jun 2009 03:35:38 +0000 (20:35 -0700)
The AA line and point code also needs to free token arrays after
building driver shaders.

src/gallium/auxiliary/draw/draw_pipe_aaline.c
src/gallium/auxiliary/draw/draw_pipe_aapoint.c

index 9fedeef2d34cff3ee4cd817075b4256b84fb4219..0d322b0aab701a097ea160e9eb1b4f4288eec55d 100644 (file)
@@ -60,8 +60,6 @@ struct aaline_fragment_shader
    struct pipe_shader_state state;
    void *driver_fs;
    void *aaline_fs;
-   void *aapoint_fs; /* not yet */
-   void *sprite_fs; /* not yet */
    uint sampler_unit;
    int generic_attrib;  /**< texcoord/generic used for texture */
 };
@@ -373,10 +371,15 @@ generate_aaline_fs(struct aaline_stage *aaline)
    aaline->fs->aaline_fs
       = aaline->driver_create_fs_state(aaline->pipe, &aaline_fs);
    if (aaline->fs->aaline_fs == NULL)
-      return FALSE;
+      goto fail;
 
    aaline->fs->generic_attrib = transform.maxGeneric + 1;
+   FREE((void *)aaline_fs.tokens);
    return TRUE;
+
+fail:
+   FREE((void *)aaline_fs.tokens);
+   return FALSE;
 }
 
 
index 66839f7873ced1aa53eee3f221ead317259d5585..729cf75e65968555d38f0e9e1761ba9f2cf0ed15 100644 (file)
@@ -523,11 +523,15 @@ generate_aapoint_fs(struct aapoint_stage *aapoint)
    aapoint->fs->aapoint_fs
       = aapoint->driver_create_fs_state(aapoint->pipe, &aapoint_fs);
    if (aapoint->fs->aapoint_fs == NULL)
-      return FALSE;
+      goto fail;
 
    aapoint->fs->generic_attrib = transform.maxGeneric + 1;
-
+   FREE((void *)aapoint_fs.tokens);
    return TRUE;
+
+fail:
+   FREE((void *)aapoint_fs.tokens);
+   return FALSE;
 }