comparison audacious/mainwin.c @ 2141:06a86fdd4fb7 trunk

[svn] added playlist_free and ensure that each created playlist is freed in mainwin_quit_cb; the list of playlists is freed there as well
author giacomo
date Sat, 16 Dec 2006 05:18:19 -0800
parents 299651a8f107
children a96b2e7ca58c
comparison
equal deleted inserted replaced
2140:299651a8f107 2141:06a86fdd4fb7
699 } 699 }
700 700
701 void 701 void
702 mainwin_quit_cb(void) 702 mainwin_quit_cb(void)
703 { 703 {
704 GList *playlists = NULL, *playlists_top = NULL;
705
704 gtk_widget_hide(equalizerwin); 706 gtk_widget_hide(equalizerwin);
705 gtk_widget_hide(playlistwin); 707 gtk_widget_hide(playlistwin);
706 gtk_widget_hide(mainwin); 708 gtk_widget_hide(mainwin);
707 gdk_flush(); 709 gdk_flush();
708 710
714 gtk_accel_map_save(bmp_paths[BMP_PATH_ACCEL_FILE]); 716 gtk_accel_map_save(bmp_paths[BMP_PATH_ACCEL_FILE]);
715 717
716 ctrlsocket_cleanup(); 718 ctrlsocket_cleanup();
717 719
718 playlist_stop_get_info_thread(); 720 playlist_stop_get_info_thread();
719 playlist_clear(playlist_get_active()); 721
722 /* free and clear each playlist */
723 playlists = playlist_get_playlists();
724 playlists_top = playlists;
725 while ( playlists != NULL )
726 {
727 playlist_clear((Playlist*)playlists->data);
728 playlist_free((Playlist*)playlists->data);
729 playlists = g_list_next(playlists);
730 }
731 g_list_free( playlists_top );
720 732
721 plugin_system_cleanup(); 733 plugin_system_cleanup();
722 734
723 gtk_main_quit(); 735 gtk_main_quit();
724 736
725 exit(EXIT_SUCCESS); 737 exit(EXIT_SUCCESS);
726 } 738 }
727 739