Fix some scePsmf leaks.

This commit is contained in:
Unknown W. Brackets 2014-03-30 13:14:17 -07:00
parent ea9a6c1b58
commit c6f52db194

View File

@ -879,6 +879,8 @@ int scePsmfPlayerCreate(u32 psmfPlayer, u32 psmfPlayerDataAddr)
if (!psmfplayer) { if (!psmfplayer) {
// TODO: This is the wrong data. PsmfPlayer needs a new interface. // TODO: This is the wrong data. PsmfPlayer needs a new interface.
psmfplayer = new PsmfPlayer(psmfPlayerDataAddr); psmfplayer = new PsmfPlayer(psmfPlayerDataAddr);
if (psmfPlayerMap.find(psmfPlayer) != psmfPlayerMap.end())
delete psmfPlayerMap[psmfPlayer];
psmfPlayerMap[psmfPlayer] = psmfplayer; psmfPlayerMap[psmfPlayer] = psmfplayer;
} }
@ -1086,6 +1088,8 @@ int scePsmfPlayerStart(u32 psmfPlayer, u32 psmfPlayerData, int initPts)
if (!psmfplayer) { if (!psmfplayer) {
psmfplayer = new PsmfPlayer(psmfPlayerData); psmfplayer = new PsmfPlayer(psmfPlayerData);
if (psmfPlayerMap.find(psmfPlayer) != psmfPlayerMap.end())
delete psmfPlayerMap[psmfPlayer];
psmfPlayerMap[psmfPlayer] = psmfplayer; psmfPlayerMap[psmfPlayer] = psmfplayer;
} }