Skip to content

Commit

Permalink
Fix minor memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
KinoMyu committed Apr 1, 2018
1 parent 45c91a5 commit 5e6a9b8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,11 @@ void MainWindow::setBGM(const QString& qStr)
std::string convSongName = readablesong_to_filename[currSong];
isusotsuki = convSongName == "macpri";
unitsize = isusotsuki ? 1 : oldunitsize;
if(isusotsuki)
{
BASS_ChannelSetSync(bgm->get_decode_channel(), BASS_SYNC_SETPOS, 0, add_usotsuki, idols[0]);
BASS_ChannelSetSync(bgm->get_decode_channel(), BASS_SYNC_POS, 4575494 * 4, add_usotsuki, idols[0]);
}
ui->usotsukilabel->setVisible(isusotsuki);
ui->soloButton->setVisible(!isusotsuki);
ui->unitButton->setVisible(!isusotsuki);
Expand Down Expand Up @@ -399,8 +404,6 @@ void MainWindow::setIdol(int index)
QWORD len = BASS_ChannelGetLength(idols[0]->get_decode_channel(), BASS_POS_BYTE);
QWORD mappos = BASS_ChannelGetPosition(bgm->get_decode_channel(), BASS_POS_BYTE) / 2 - 4575494 * 2;
BASS_ChannelSetPosition(idols[0]->get_decode_channel(), mappos >= len || mappos < 0 ? len - 1 : mappos, BASS_POS_BYTE);
BASS_ChannelSetSync(bgm->get_decode_channel(), BASS_SYNC_SETPOS, 0, add_usotsuki, idols[0]);
BASS_ChannelSetSync(bgm->get_decode_channel(), BASS_SYNC_POS, 4575494 * 4, add_usotsuki, idols[0]);
}
}

Expand Down

0 comments on commit 5e6a9b8

Please sign in to comment.