diff options
| author | Carl Hetherington <cth@carlh.net> | 2021-12-20 00:35:11 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2022-04-29 00:45:40 +0200 |
| commit | 78ca79cde19db630b1abfe8f00f49e87bb7e4068 (patch) | |
| tree | 162e17e2413e57e10cf841212c5d29b9ff97b400 /src/lib/filter.cc | |
| parent | f25061b8a6f35e490b731caefe63560045b10a1f (diff) | |
Fix a load of stuff that wasn't being freed on close.
Nothing really that important, but it cleans up the valgrind
leak check reports.
Diffstat (limited to 'src/lib/filter.cc')
| -rw-r--r-- | src/lib/filter.cc | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/lib/filter.cc b/src/lib/filter.cc index bb48805e6..9158cba5c 100644 --- a/src/lib/filter.cc +++ b/src/lib/filter.cc @@ -38,7 +38,7 @@ LIBDCP_ENABLE_WARNINGS using namespace std; -vector<Filter const *> Filter::_filters; +vector<Filter> Filter::_filters; /** @param i Our id. @@ -60,7 +60,11 @@ Filter::Filter (string i, string n, string c, string f) vector<Filter const *> Filter::all () { - return _filters; + vector<Filter const *> raw; + for (auto& filter: _filters) { + raw.push_back (&filter); + } + return raw; } @@ -100,7 +104,7 @@ Filter::maybe_add (string i, string n, string c, string f) } if (avfilter_get_by_name(check_name.c_str())) { - _filters.push_back (new Filter(i, n, c, f)); + _filters.push_back (Filter(i, n, c, f)); } } @@ -131,7 +135,7 @@ Filter const * Filter::from_id (string d) { auto i = _filters.begin (); - while (i != _filters.end() && (*i)->id() != d) { + while (i != _filters.end() && i->id() != d) { ++i; } @@ -139,5 +143,5 @@ Filter::from_id (string d) return nullptr; } - return *i; + return &(*i); } |
