Skip to content

Commit

Permalink
Lv2Proc: Fix shutdown routine (LMMS#6944)
Browse files Browse the repository at this point in the history
  • Loading branch information
JohannesLorenz committed Nov 12, 2023
1 parent c779521 commit 379acb9
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 2 deletions.
2 changes: 2 additions & 0 deletions include/Lv2Options.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ class Lv2Options
return m_options.data();
}

void clear();

private:
//! Initialize an option internally
void initOption(LV2_URID key,
Expand Down
2 changes: 1 addition & 1 deletion include/Lv2Proc.h
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ class Lv2Proc : public LinkedModelGroup
bool m_valid = true;

const LilvPlugin* m_plugin;
LilvInstance* m_instance;
LilvInstance* m_instance = nullptr;
Lv2Features m_features;

// options
Expand Down
7 changes: 6 additions & 1 deletion src/core/lv2/Lv2Features.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,12 @@ void *&Lv2Features::operator[](const char *featName)

void Lv2Features::clear()
{
m_featureByUri.clear();
m_features.clear();
for (auto& [uri, feature] : m_featureByUri)
{
(void) uri;
feature = nullptr;
}
}


Expand Down
10 changes: 10 additions & 0 deletions src/core/lv2/Lv2Options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,16 @@ void Lv2Options::initOption(LV2_URID key, uint32_t size, LV2_URID type,
}




void Lv2Options::clear()
{
m_options.clear();
m_optionValues.clear();
m_optionByUrid.clear();
}


} // namespace lmms

#endif // LMMS_HAVE_LV2
1 change: 1 addition & 0 deletions src/core/lv2/Lv2Proc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,7 @@ void Lv2Proc::shutdownPlugin()
m_instance = nullptr;

m_features.clear();
m_options.clear();
}
m_valid = true;
}
Expand Down

0 comments on commit 379acb9

Please sign in to comment.