diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2014-10-19 06:32:03 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2014-10-19 06:32:03 +0200 |
commit | 0ede2311faefd5bc8a52dda33d866bd9f3db7428 (patch) | |
tree | 4af85bf9f85a13c7907074f5c15ca02bf9d3d6cf /facetracknoir/plugin-support.cpp | |
parent | cd8c47dc628016d470268bbed3c29461ffed296d (diff) |
reduce leakage somewhat by using shared_ptr
Found-by: valgrind
Diffstat (limited to 'facetracknoir/plugin-support.cpp')
-rw-r--r-- | facetracknoir/plugin-support.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/facetracknoir/plugin-support.cpp b/facetracknoir/plugin-support.cpp index e9154bb7..5b65df47 100644 --- a/facetracknoir/plugin-support.cpp +++ b/facetracknoir/plugin-support.cpp @@ -29,28 +29,27 @@ SelectedLibraries::SelectedLibraries(IDynamicLibraryProvider* mainApp) : correct = false; if (!mainApp) return; - CTOR_FUNPTR ptr; - DynamicLibrary* lib; + CTOR_FUNPTR p; - lib = mainApp->current_tracker1(); + ptr<DynamicLibrary> lib = mainApp->current_tracker1(); if (lib && lib->Constructor) { - ptr = (CTOR_FUNPTR) lib->Constructor; - pTracker = (ITracker*) ptr(); + p = (CTOR_FUNPTR) lib->Constructor; + pTracker = (ITracker*) p(); } lib = mainApp->current_protocol(); if (lib && lib->Constructor) { - ptr = (CTOR_FUNPTR) lib->Constructor; - pProtocol = (IProtocol*) ptr(); + p = (CTOR_FUNPTR) lib->Constructor; + pProtocol = (IProtocol*) p(); } lib = mainApp->current_filter(); if (lib && lib->Constructor) { - ptr = (CTOR_FUNPTR) lib->Constructor; - pFilter = (IFilter*) ptr(); + p = (CTOR_FUNPTR) lib->Constructor; + pFilter = (IFilter*) p(); } if (pProtocol) |