r300g: Fix leaks in failed context creation
authornobled <nobled@dreamwidth.org>
Sun, 15 Aug 2010 03:59:15 +0000 (03:59 +0000)
committerMarek Olšák <maraeo@gmail.com>
Mon, 16 Aug 2010 02:59:58 +0000 (04:59 +0200)
commit1e2cd02eae9d27e48273f4a548dc51f4f838eb96
treed4eeddad3da3a59519fec93c27405a3867407835
parentb0e1565b5f24c3f624745890170cce0700e620ff
r300g: Fix leaks in failed context creation

This changes r300_destroy_context() so it can be called
on a partially-initialized context, and uses it when
r300_create_context() hits a fatal error.

This makes sure r300_create_context() doesn't leak memory
or neglect to call r300_update_num_contexts() when it fails.

Signed-off-by: Marek Olšák <maraeo@gmail.com>
src/gallium/drivers/r300/r300_context.c