From 3af442ba52550a9d183e215d49cc12dac0cb9e4b Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 11 Oct 2007 11:56:06 -0700 Subject: Don't double-free the memory manager allocation. --- src/i830_memory.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/i830_memory.c b/src/i830_memory.c index 0b046f6d..9dfe43e6 100644 --- a/src/i830_memory.c +++ b/src/i830_memory.c @@ -279,8 +279,18 @@ i830_reset_allocations(ScrnInfoPtr pScrn) int p; /* While there is any memory between the start and end markers, free it. */ - while (pI830->memory_list->next->next != NULL) + while (pI830->memory_list->next->next != NULL) { + i830_memory *mem = pI830->memory_list->next; + + /* Don't reset BO allocator, which we set up at init. */ + if (pI830->memory_manager == mem) { + mem = mem->next; + if (mem->next == NULL) + break; + } + i830_free_memory(pScrn, pI830->memory_list->next); + } /* Free any allocations in buffer objects */ #ifdef XF86DRI_MM -- cgit v1.2.3