diff options
| author | Stanislaw Halik <sthalik@misaki.pl> | 2015-09-05 07:46:47 +0200 | 
|---|---|---|
| committer | Stanislaw Halik <sthalik@misaki.pl> | 2015-09-05 08:12:30 +0200 | 
| commit | bed620cc85b71e5c02c86613d22624a5c12189ce (patch) | |
| tree | 68d34ede75b100cd2924565bb711821611a363c0 | |
| parent | e355edfab17d931d63106fb0afc7f57dfdceeb6d (diff) | |
plugin-support: workaround multiple copies of modules
TrackHat dist contained two copies of every module by packaging error.
Workaround similar errors by not loading more than one copy of a module
at a time.
Sponsored-by: TrackHat
| -rw-r--r-- | opentrack/plugin-support.hpp | 8 | 
1 files changed, 8 insertions, 0 deletions
| diff --git a/opentrack/plugin-support.hpp b/opentrack/plugin-support.hpp index 8b9cf58a..8efda800 100644 --- a/opentrack/plugin-support.hpp +++ b/opentrack/plugin-support.hpp @@ -187,6 +187,14 @@ struct dylib {                  std::cout.flush();                  if (!get_metadata(lib, longName, icon))                      continue; +                using d = const mem<dylib>&; +                if (std::any_of(ret.cbegin(), +                                ret.cend(), +                                [&](d a) {return a->type == lib->type && a->name == lib->name;})) +                { +                    qDebug() << "Duplicate lib" << lib->filename; +                    continue; +                }                  ret.push_back(lib);              }          } | 
