Skip to content

Commit

Permalink
sysex collector: clear() sysex in reset()
Browse files Browse the repository at this point in the history
clear will not free the memory of the underlying vector
  • Loading branch information
timblechmann committed Nov 9, 2023
1 parent b34b89e commit c19ae57
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/sysex_collector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ void sysex7_collector::feed(const universal_packet& p)
if (m_cb)
{
m_cb(m_sysex7);
m_sysex7.clear();
}
reset();
break;
Expand All @@ -139,7 +138,7 @@ void sysex7_collector::feed(const universal_packet& p)

void sysex7_collector::reset()
{
m_sysex7 = sysex7{};
m_sysex7.clear();
m_state = data_status::sysex7_start;
m_manufacturerIDBytesRead = 0;
}
Expand Down Expand Up @@ -250,7 +249,6 @@ void sysex8_collector::feed(const universal_packet& p)
if (m_cb)
{
m_cb(m_sysex8, m_stream_id);
m_sysex8.clear();
}
reset();
break;
Expand All @@ -264,8 +262,8 @@ void sysex8_collector::feed(const universal_packet& p)

void sysex8_collector::reset()
{
m_sysex8.clear();
m_stream_id = 0;
m_sysex8 = sysex8{};
m_state = packet_format::start;
m_manufacturer_id_state = detect;
}
Expand Down

0 comments on commit c19ae57

Please sign in to comment.