Skip to content

Commit

Permalink
gui: fix crash in Oscilloscope when selecting the Trigger B
Browse files Browse the repository at this point in the history
A crash occured when Trigger B was selected, but the channel B was not enabled.
  • Loading branch information
nooploop committed Aug 30, 2024
1 parent c3b9da0 commit 84b0192
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
8 changes: 0 additions & 8 deletions piejam_libs/gui/include/piejam/gui/model/StreamProcessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,6 @@ struct StreamProcessor
}
}

void drop(std::size_t const frames)
{
for (auto&& processor : processors)
{
processor->drop(frames);
}
}

void clear()
{
for (auto&& processor : processors)
Expand Down
7 changes: 5 additions & 2 deletions piejam_libs/gui/src/piejam/gui/model/ScopeDataGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ namespace piejam::gui::model
namespace
{

using ScopeSamples = std::span<float const>;

struct Args
{
std::size_t resolution{1};
Expand Down Expand Up @@ -165,6 +163,11 @@ findTrigger(
TriggerSlope const trigger,
float triggerLevel) -> ScopeData::Samples::iterator
{
if (samples.empty())
{
return samples.end();
}

BOOST_ASSERT(samples.size() >= windowSize);

auto itFirst = samples.begin();
Expand Down

0 comments on commit 84b0192

Please sign in to comment.