Permalink
Browse files

Fix PlayHandle buffer leak

Fixes #3169
  • Loading branch information...
lukas-w committed Feb 11, 2017
1 parent f937357 commit 4254597fae5b173ab235046d6fca329a9e186970
Showing with 1 addition and 0 deletions.
  1. +1 −0 src/core/PlayHandle.cpp
View
@@ -38,6 +38,7 @@ PlayHandle::PlayHandle( const Type type, f_cnt_t offset ) :
PlayHandle::~PlayHandle()
{
BufferManager::release(m_playHandleBuffer);
}

3 comments on commit 4254597

@zonkmachine

This comment has been minimized.

Show comment
Hide comment
@zonkmachine

zonkmachine Feb 11, 2017

Member

@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);

Member

zonkmachine replied Feb 11, 2017

@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

This comment has been minimized.

Show comment
Hide comment
@lukas-w

lukas-w Feb 12, 2017

Member

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

Member

lukas-w replied Feb 12, 2017

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

@zonkmachine

This comment has been minimized.

Show comment
Hide comment
@zonkmachine

zonkmachine Feb 12, 2017

Member

@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!

Member

zonkmachine replied Feb 12, 2017

@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.