Skip to content

Commit

Permalink
Fix PlayHandle buffer leak
Browse files Browse the repository at this point in the history
Fixes #3169
  • Loading branch information
lukas-w committed Feb 11, 2017
1 parent f937357 commit 4254597
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/core/PlayHandle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ PlayHandle::PlayHandle( const Type type, f_cnt_t offset ) :

PlayHandle::~PlayHandle()
{
BufferManager::release(m_playHandleBuffer);
}


Expand Down

3 comments on commit 4254597

@zonkmachine
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lukas-w It crashes in SDL for me on switching project.

Core was generated by `./lmms'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  memset () at ../sysdeps/x86_64/memset.S:78
78	../sysdeps/x86_64/memset.S: No such file or directory.
(gdb) bt
#0  memset () at ../sysdeps/x86_64/memset.S:78
#1  0x00000000004ecf7e in BufferManager::clear (ab=0x0, frames=256, offset=0) at /home/zonkmachine/builds/lmms/lmms/src/core/BufferManager.cpp:77
#2  0x000000000056712b in AudioPort::doProcessing (this=0x7fa8f8b2c870) at /home/zonkmachine/builds/lmms/lmms/src/core/audio/AudioPort.cpp:117
#3  0x0000000000515713 in ThreadableJob::process (this=0x7fa8f8b2c870) at /home/zonkmachine/builds/lmms/lmms/include/ThreadableJob.h:74
#4  0x000000000052cb73 in MixerWorkerThread::JobQueue::run (this=0x945400 <MixerWorkerThread::globalJobQueue>)
    at /home/zonkmachine/builds/lmms/lmms/src/core/MixerWorkerThread.cpp:75

This fixes it for me.
if( m_playHandleBuffer )BufferManager::release(m_playHandleBuffer);

@lukas-w
Copy link
Member Author

@lukas-w lukas-w commented on 4254597 Feb 12, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zonkmachine I can only reproduce that crash when switching project while playing. Nevertheless, e6b5712 should fix it.

@zonkmachine
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lukas-w The project that went down while stopped had a VST in it under Wine/Linuxmint. It any case the last commit fixed it. Thanks!

Please sign in to comment.