summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2007-10-11 11:56:06 -0700
committerEric Anholt <eric@anholt.net>2007-10-11 12:17:15 -0700
commit3af442ba52550a9d183e215d49cc12dac0cb9e4b (patch)
tree02f6ffcf759e84211dd554c57d2814ee2cdc91fb
parent6c485ff5bd25e9aa6a3c1eb669843e6b969d94df (diff)
Don't double-free the memory manager allocation.
-rw-r--r--src/i830_memory.c12
1 files changed, 11 insertions, 1 deletions
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