From 6468223986ede1b1b64581dd37fed11724788a2b Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 5 Jul 2015 18:54:59 +0200 Subject: libs: validate protocol first before starting tracker --- opentrack/selected-libraries.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'opentrack') diff --git a/opentrack/selected-libraries.cpp b/opentrack/selected-libraries.cpp index 8cb226c8..7617ce90 100644 --- a/opentrack/selected-libraries.cpp +++ b/opentrack/selected-libraries.cpp @@ -20,19 +20,27 @@ SelectedLibraries::SelectedLibraries(QFrame* frame, dylibptr t, dylibptr p, dyli pProtocol(nullptr), correct(false) { - pTracker = make_instance(t); pProtocol = make_instance(p); - pFilter = make_instance(f); - if (!pTracker || !pProtocol) + if (!pProtocol) { - qDebug() << "dylib load failure"; + qDebug() << "protocol dylib load failure"; return; } if(!pProtocol->correct()) { qDebug() << "protocol load failure"; + pProtocol = nullptr; + return; + } + + pTracker = make_instance(t); + pFilter = make_instance(f); + + if (!pTracker) + { + qDebug() << "tracker dylib load failure"; return; } -- cgit v1.2.3