Skip to content

Commit

Permalink
[Imp] Sample tab: Avoid holding audio lock while updating UI after pa…
Browse files Browse the repository at this point in the history
…sting a sample.

git-svn-id: https://source.openmpt.org/svn/openmpt/trunk/OpenMPT@20311 56274372-70c3-4bfc-bfc3-4c3a0b034d27
  • Loading branch information
sagamusix committed Mar 12, 2024
1 parent fc3fbaf commit c80d559
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mptrack/View_smp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2716,6 +2716,7 @@ void CViewSample::DoPaste(PasteMode pasteMode)
int16 *pNewSample = static_cast<int16 *>(ModSample::AllocateSample(newLength, 2u * newNumChannels));
if(pNewSample == nullptr)
{
cs.Leave();
ErrorBox(IDS_ERR_OUTOFMEMORY, this);
ok = false;
} else
Expand Down Expand Up @@ -2795,6 +2796,7 @@ void CViewSample::DoPaste(PasteMode pasteMode)
{
SetCurSel(selBegin, selEnd);
sample.PrecomputeLoops(sndFile, true);
cs.Leave();
SetModified(SampleHint().Info().Data().Names(), true, false);
if(pasteMode == PasteMode::Replace)
{
Expand Down

0 comments on commit c80d559

Please sign in to comment.