src/video/SDL_rect.c
changeset 2224 29cc9e9c76bd
parent 2223 175754591a13
child 2275 12ea0fdc0df2
     1.1 --- a/src/video/SDL_rect.c	Sat Aug 11 21:34:08 2007 +0000
     1.2 +++ b/src/video/SDL_rect.c	Sat Aug 11 21:42:36 2007 +0000
     1.3 @@ -149,7 +149,20 @@
     1.4  void
     1.5  SDL_ClearDirtyRects(SDL_DirtyRectList * list)
     1.6  {
     1.7 -    list->free = list->list;
     1.8 +    SDL_DirtyRect *prev, *curr;
     1.9 +
    1.10 +    /* Skip to the end of the free list */
    1.11 +    prev = NULL;
    1.12 +    for (curr = list->free; curr; curr = curr->next) {
    1.13 +        prev = curr;
    1.14 +    }
    1.15 +
    1.16 +    /* Add the list entries to the end */
    1.17 +    if (prev) {
    1.18 +        prev->next = list->list;
    1.19 +    } else {
    1.20 +        list->free = list->list;
    1.21 +    }
    1.22      list->list = NULL;
    1.23      list->count = 0;
    1.24  }