• R/O
  • HTTP
  • SSH
  • HTTPS

コミット

タグ
未設定

よく使われているワード(クリックで追加)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

コミットメタ情報

リビジョン795c71663dcd2f832d0409ee89e1c1bd355c42a1 (tree)
日時2018-04-28 17:40:50
作者Starg <starg@user...>
コミッターStarg

ログメッセージ

Fix uninitializing playlist

変更サマリ

差分

--- a/interface/w32g_playlist.c
+++ b/interface/w32g_playlist.c
@@ -1404,27 +1404,38 @@ void w32g_free_playlist(void)
14041404 for(j=0; j < PLAYLIST_MAX; j++){
14051405 for(i=0; i < playlist[j].nfiles; i++){
14061406 entry = &playlist[j].list[i];
1407- if(entry->filepath != NULL) free(entry->filepath);
1407+ free(entry->filepath);
1408+ entry->filepath = NULL;
14081409 #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;
14121416 #endif
14131417 }
1414- if(playlist[j].list != NULL) free(playlist[j].list);
1418+ free(playlist[j].list);
1419+ playlist[j].list = NULL;
14151420 }
1416- if(playlist_shuffle.list != NULL) free(playlist_shuffle.list);
1421+ free(playlist_shuffle.list);
1422+ playlist_shuffle.list = NULL;
14171423
14181424 #ifdef LISTVIEW_PLAYLIST
14191425 // clear tmp_playlist
14201426 for(i = 0; i < tmp_playlist.nfiles; i++){
14211427 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;
14261436 }
1427- if(tmp_playlist.list != NULL) free(tmp_playlist.list);
1437+ free(tmp_playlist.list);
1438+ tmp_playlist.list = NULL;
14281439 #endif
14291440 }
14301441