# HG changeset patch # User Sam Lantinga # Date 1186868556 0 # Node ID 29cc9e9c76bda0f2685418e8e699f5803ba65203 # Parent 175754591a131e793e7fb5722baf37ff437ca2bf Whoops, it's not quite that easy - fixed bug in SDL_ClearDirtyRects() diff -r 175754591a13 -r 29cc9e9c76bd src/video/SDL_rect.c --- a/src/video/SDL_rect.c Sat Aug 11 21:34:08 2007 +0000 +++ b/src/video/SDL_rect.c Sat Aug 11 21:42:36 2007 +0000 @@ -149,7 +149,20 @@ void SDL_ClearDirtyRects(SDL_DirtyRectList * list) { - list->free = list->list; + SDL_DirtyRect *prev, *curr; + + /* Skip to the end of the free list */ + prev = NULL; + for (curr = list->free; curr; curr = curr->next) { + prev = curr; + } + + /* Add the list entries to the end */ + if (prev) { + prev->next = list->list; + } else { + list->free = list->list; + } list->list = NULL; list->count = 0; }