From dfa22df8ce7713b491c4766ce6ce652db91b5f90 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 5 Oct 2007 12:53:07 -0700 Subject: [PATCH] Don't leak buffer object allocations in i830_reset_allocations(). --- src/i830_memory.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/i830_memory.c b/src/i830_memory.c index c850033b..d2aa3270 100644 --- a/src/i830_memory.c +++ b/src/i830_memory.c @@ -272,6 +272,14 @@ i830_reset_allocations(ScrnInfoPtr pScrn) while (pI830->memory_list->next->next != NULL) i830_free_memory(pScrn, pI830->memory_list->next); + /* Free any allocations in buffer objects */ +#ifdef XF86DRI_MM + if (pI830->memory_manager) { + while (pI830->bo_list != NULL) + i830_free_memory(pScrn, pI830->bo_list); + } +#endif + /* Null out the pointers for all the allocations we just freed. This is * kind of gross, but at least it's just one place now. */