Commit 898712a85c80d037446c7c5871c2491ae7fdbad7
1 parent
4fa0f5d2
sdl_cleanup fix (Martin Garton)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@603 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
8 additions
and
0 deletions
sdl.c
| ... | ... | @@ -52,6 +52,7 @@ static int gui_grab; /* if true, all keyboard/mouse events are grabbed */ |
| 52 | 52 | |
| 53 | 53 | static void sdl_update(DisplayState *ds, int x, int y, int w, int h) |
| 54 | 54 | { |
| 55 | + // printf("updating x=%d y=%d w=%d h=%d\n", x, y, w, h); | |
| 55 | 56 | SDL_UpdateRect(screen, x, y, w, h); |
| 56 | 57 | } |
| 57 | 58 | |
| ... | ... | @@ -257,6 +258,11 @@ static void sdl_refresh(DisplayState *ds) |
| 257 | 258 | } |
| 258 | 259 | } |
| 259 | 260 | |
| 261 | +static void sdl_cleanup(void) | |
| 262 | +{ | |
| 263 | + SDL_Quit(); | |
| 264 | +} | |
| 265 | + | |
| 260 | 266 | void sdl_display_init(DisplayState *ds) |
| 261 | 267 | { |
| 262 | 268 | int flags; |
| ... | ... | @@ -278,4 +284,6 @@ void sdl_display_init(DisplayState *ds) |
| 278 | 284 | SDL_WM_SetCaption("QEMU", "QEMU"); |
| 279 | 285 | SDL_EnableKeyRepeat(250, 50); |
| 280 | 286 | gui_grab = 0; |
| 287 | + | |
| 288 | + atexit(sdl_cleanup); | |
| 281 | 289 | } | ... | ... |