diff options
| author | Carl Hetherington <cth@carlh.net> | 2021-12-20 00:35:11 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2021-12-23 12:59:56 +0100 |
| commit | a7f61a15fc974feaff1554bd5322650676a63c51 (patch) | |
| tree | a94f18afc7b1083bc46cb2ba901d889d6d5ccb63 /src/lib/filter.cc | |
| parent | 607a824efbcb0ae9d5b664e919ae983224e712a0 (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 5631af55a..8bf1d0abd 100644 --- a/src/lib/filter.cc +++ b/src/lib/filter.cc @@ -39,7 +39,7 @@ DCPOMATIC_ENABLE_WARNINGS using namespace std; -vector<Filter const *> Filter::_filters; +vector<Filter> Filter::_filters; /** @param i Our id. @@ -61,7 +61,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; } @@ -101,7 +105,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)); } } @@ -132,7 +136,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; } @@ -140,5 +144,5 @@ Filter::from_id (string d) return nullptr; } - return *i; + return &(*i); } |
