* Don't try to free the pages area when all you had was a single page (in the

union).
* This fixes a crash on restart that has been revealed by Oco's change to the
  reboot process.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30085 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2009-04-09 22:40:15 +00:00
parent 1f25254a3f
commit 7f5c5dc8a1
@@ -1,5 +1,5 @@
/*
* Copyright 2008, Axel Dörfler, [email protected]. All rights reserved.
* Copyright 2008-2009, Axel Dörfler, [email protected].
* Copyright 2004-2006, Rudolf Cornelissen. All rights reserved.
*
* Distributed under the terms of the MIT License.
@@ -690,14 +690,16 @@ Aperture::_Free(aperture_memory *memory)
for (uint32 i = 0; i < count; i++, page++) {
vm_page_set_state(page, PAGE_STATE_FREE);
}
memory->page = NULL;
} else {
for (uint32 i = 0; i < count; i++) {
vm_page_set_state(memory->pages[i], PAGE_STATE_FREE);
}
}
free(memory->pages);
memory->pages = NULL;
free(memory->pages);
memory->pages = NULL;
}
#else
delete_area(memory->area);
memory->area = -1;