Skip to content

Commit

Permalink
Timeshift: Truncate buffer file on stop
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelm committed Jan 29, 2017
1 parent 39d7bc9 commit f8008d2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/TimeshiftBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,13 @@ TimeshiftBuffer::~TimeshiftBuffer(void)
StopThread(0);

if (m_filebufferWriteHandle)
{
// XBMC->TruncateFile doesn't work for unknown reasons
XBMC->CloseFile(m_filebufferWriteHandle);
void *tmp;
if ((tmp = XBMC->OpenFileForWrite(m_bufferPath.c_str(), true)) != nullptr)
XBMC->CloseFile(tmp);
}
if (m_filebufferReadHandle)
XBMC->CloseFile(m_filebufferReadHandle);
SAFE_DELETE(m_strReader);
Expand Down

0 comments on commit f8008d2

Please sign in to comment.