diff options
| author | Dusan Durech <dusan@debian.(none)> | 2009-12-22 00:33:13 +0100 |
|---|---|---|
| committer | Dusan Durech <dusan@debian.(none)> | 2009-12-22 00:33:13 +0100 |
| commit | b679c532c63f556cc0355fe7118d7470c488ceda (patch) | |
| tree | 171dd14bf1080409ed4118ba519cd2c22a0c70e7 /src | |
| parent | 5e926d3e7586d764eeaedf6f3951d5598cf553b5 (diff) | |
fix bug with quit net mutiplayer (program crashed) and fix memory leak, program tested under valgrind
Diffstat (limited to 'src')
| -rw-r--r-- | src/client/mouse_buffer.c | 4 | ||||
| -rw-r--r-- | src/screen/world.c | 11 |
2 files changed, 9 insertions, 6 deletions
diff --git a/src/client/mouse_buffer.c b/src/client/mouse_buffer.c index 207951d..f301b28 100644 --- a/src/client/mouse_buffer.c +++ b/src/client/mouse_buffer.c @@ -66,7 +66,9 @@ int mouse_buffer_event(SDL_MouseButtonEvent *button) int mouse_buffer_clean() { assert(list_event != NULL); - list_do_empty(list_event); + + list_destroy_item(list_event, mouse_event_destroy); + list_event = list_new(); return 0; } diff --git a/src/screen/world.c b/src/screen/world.c index 022a30d..2b96919 100644 --- a/src/screen/world.c +++ b/src/screen/world.c @@ -440,10 +440,6 @@ void stoptWorld() hot_key_unregister(SDLK_ESCAPE); arena_quit(); - if (arena != NULL) { - arena_destroy(arena); - } - radar_quit(); pauza_quit(); term_quit(); @@ -467,9 +463,14 @@ void stoptWorld() #endif /* NO_SOUND */ module_quit(); chat_quit(); - id_quit_list(); net_multiplayer_quit(); + + if (arena != NULL) { + arena_destroy(arena); + } + + id_quit_list(); } void world_init() |