From bed620cc85b71e5c02c86613d22624a5c12189ce Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 5 Sep 2015 07:46:47 +0200 Subject: 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 --- opentrack/plugin-support.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) 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&; + 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); } } -- cgit v1.2.3