Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SampleTrack: call requestChangesInModel before unref SampleBuffer #4982

Merged
merged 1 commit into from May 27, 2019

Conversation

Projects
None yet
2 participants
@Reflexe
Copy link
Member

commented May 19, 2019

To avoid a race condition between the gui thread which destroys the
samplebuffer and the mixer thread which increases the buffer's ref-
count, we'll make sure to touch the ref-count only when whe're synced
with the mixer.

Closes #4980.

@@ -133,7 +135,9 @@ const QString & SampleTCO::sampleFile() const

void SampleTCO::setSampleBuffer( SampleBuffer* sb )
{
sharedObject::unref( m_sampleBuffer );
Engine::mixer()->requestChangeInModel();
sharedObject::unref( m_sampleBuffer );

This comment has been minimized.

Copy link
@PhysSong

PhysSong May 19, 2019

Member

Spaces.

This comment has been minimized.

Copy link
@PhysSong

PhysSong May 19, 2019

Member

Also, the indentation looks somewhat weird to me.

SampleTrack: call requestChangesInModel before unref SampleBuffer
To avoid a race condition between the gui thread which destroys the
samplebuffer and the mixer thread which increases the buffer's ref-
count, we'll make sure to touch the ref-count only when whe're synced
with the mixer.

@Reflexe Reflexe force-pushed the Reflexe:fix/sample_tco_crash branch from ccff7d6 to ec0fd30 May 19, 2019

@Reflexe Reflexe merged commit 9c6e227 into LMMS:stable-1.2 May 27, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.