From 8f61232b36e5988e3bb89ad42b821c89c57073d7 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 24 Aug 2015 10:05:27 +0200 Subject: plugin-support: free modules from address space when needed This is groundwork for #226, even though modules still need not to load all at once and persist till program stop. This issue only affects Linux. --- opentrack/plugin-support.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'opentrack/plugin-support.hpp') diff --git a/opentrack/plugin-support.hpp b/opentrack/plugin-support.hpp index ec8bb3c8..c2c1b048 100644 --- a/opentrack/plugin-support.hpp +++ b/opentrack/plugin-support.hpp @@ -103,7 +103,7 @@ struct dylib { # if defined(__APPLE__) RTLD_LOCAL|RTLD_FIRST|RTLD_NOW # else - RTLD_NOW|RTLD_GLOBAL|RTLD_NODELETE + RTLD_NOW|RTLD_GLOBAL # endif ); -- cgit v1.2.3 From 0d9427dd929ca51d65a1ab08b26710647769793c Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 24 Aug 2015 10:07:46 +0200 Subject: plugin-support: set more sane RTLD flags We might need RTLD_DEEPBIND if there are symbol-related crashes. --- opentrack/plugin-support.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'opentrack/plugin-support.hpp') diff --git a/opentrack/plugin-support.hpp b/opentrack/plugin-support.hpp index c2c1b048..a9008840 100644 --- a/opentrack/plugin-support.hpp +++ b/opentrack/plugin-support.hpp @@ -103,7 +103,7 @@ struct dylib { # if defined(__APPLE__) RTLD_LOCAL|RTLD_FIRST|RTLD_NOW # else - RTLD_NOW|RTLD_GLOBAL + RTLD_LOCAL|RTLD_NOW|RTLD_NOW // XXX RTLD_DEEPBIND on Linux? # endif ); -- cgit v1.2.3 From b1c4466ddeb84ec9b6c19f64906458754f68b135 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 24 Aug 2015 10:11:29 +0200 Subject: plugin-support: fix typo --- opentrack/plugin-support.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'opentrack/plugin-support.hpp') diff --git a/opentrack/plugin-support.hpp b/opentrack/plugin-support.hpp index a9008840..8b9cf58a 100644 --- a/opentrack/plugin-support.hpp +++ b/opentrack/plugin-support.hpp @@ -103,7 +103,7 @@ struct dylib { # if defined(__APPLE__) RTLD_LOCAL|RTLD_FIRST|RTLD_NOW # else - RTLD_LOCAL|RTLD_NOW|RTLD_NOW // XXX RTLD_DEEPBIND on Linux? + RTLD_LOCAL|RTLD_NOW // XXX RTLD_DEEPBIND on Linux? # endif ); -- cgit v1.2.3 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(+) (limited to 'opentrack/plugin-support.hpp') 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