diff options
Diffstat (limited to 'opentrack/selected-libraries.cpp')
-rw-r--r-- | opentrack/selected-libraries.cpp | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/opentrack/selected-libraries.cpp b/opentrack/selected-libraries.cpp index 7617ce90..c39ee3f5 100644 --- a/opentrack/selected-libraries.cpp +++ b/opentrack/selected-libraries.cpp @@ -5,22 +5,13 @@ SelectedLibraries::~SelectedLibraries() { } -template<typename t> -static mem<t> make_instance(mem<dylib> lib) -{ - mem<t> ret; - if (lib != nullptr && lib->Constructor) - ret = mem<t>(reinterpret_cast<t*>(reinterpret_cast<OPENTRACK_CTOR_FUNPTR>(lib->Constructor)())); - return ret; -} - SelectedLibraries::SelectedLibraries(QFrame* frame, dylibptr t, dylibptr p, dylibptr f) : pTracker(nullptr), pFilter(nullptr), pProtocol(nullptr), correct(false) { - pProtocol = make_instance<IProtocol>(p); + pProtocol = make_dylib_instance<IProtocol>(p); if (!pProtocol) { @@ -35,8 +26,8 @@ SelectedLibraries::SelectedLibraries(QFrame* frame, dylibptr t, dylibptr p, dyli return; } - pTracker = make_instance<ITracker>(t); - pFilter = make_instance<IFilter>(f); + pTracker = make_dylib_instance<ITracker>(t); + pFilter = make_dylib_instance<IFilter>(f); if (!pTracker) { |