リビジョン | 795c71663dcd2f832d0409ee89e1c1bd355c42a1 (tree) |
---|---|
日時 | 2018-04-28 17:40:50 |
作者 | Starg <starg@user...> |
コミッター | Starg |
Fix uninitializing playlist
@@ -1404,27 +1404,38 @@ void w32g_free_playlist(void) | ||
1404 | 1404 | for(j=0; j < PLAYLIST_MAX; j++){ |
1405 | 1405 | for(i=0; i < playlist[j].nfiles; i++){ |
1406 | 1406 | entry = &playlist[j].list[i]; |
1407 | - if(entry->filepath != NULL) free(entry->filepath); | |
1407 | + free(entry->filepath); | |
1408 | + entry->filepath = NULL; | |
1408 | 1409 | #ifdef LISTVIEW_PLAYLIST |
1409 | - if(entry->duration != NULL) free(entry->duration); | |
1410 | - if(entry->filetype != NULL) free(entry->filetype); | |
1411 | - if(entry->system != NULL) free(entry->system); | |
1410 | + free(entry->duration); | |
1411 | + entry->duration = NULL; | |
1412 | + free(entry->filetype); | |
1413 | + entry->filetype = NULL; | |
1414 | + free(entry->system); | |
1415 | + entry->system = NULL; | |
1412 | 1416 | #endif |
1413 | 1417 | } |
1414 | - if(playlist[j].list != NULL) free(playlist[j].list); | |
1418 | + free(playlist[j].list); | |
1419 | + playlist[j].list = NULL; | |
1415 | 1420 | } |
1416 | - if(playlist_shuffle.list != NULL) free(playlist_shuffle.list); | |
1421 | + free(playlist_shuffle.list); | |
1422 | + playlist_shuffle.list = NULL; | |
1417 | 1423 | |
1418 | 1424 | #ifdef LISTVIEW_PLAYLIST |
1419 | 1425 | // clear tmp_playlist |
1420 | 1426 | for(i = 0; i < tmp_playlist.nfiles; i++){ |
1421 | 1427 | entry = &tmp_playlist.list[i]; |
1422 | - if(entry->filepath != NULL) free(entry->filepath); | |
1423 | - if(entry->duration != NULL) free(entry->duration); | |
1424 | - if(entry->filetype != NULL) free(entry->filetype); | |
1425 | - if(entry->system != NULL) free(entry->system); | |
1428 | + free(entry->filepath); | |
1429 | + entry->filepath = NULL; | |
1430 | + free(entry->duration); | |
1431 | + entry->duration = NULL; | |
1432 | + free(entry->filetype); | |
1433 | + entry->filetype = NULL; | |
1434 | + free(entry->system); | |
1435 | + entry->system = NULL; | |
1426 | 1436 | } |
1427 | - if(tmp_playlist.list != NULL) free(tmp_playlist.list); | |
1437 | + free(tmp_playlist.list); | |
1438 | + tmp_playlist.list = NULL; | |
1428 | 1439 | #endif |
1429 | 1440 | } |
1430 | 1441 |