From ab0d60becc2d1b89c812193c179892d6acd4912f Mon Sep 17 00:00:00 2001 From: Patrick Ruoff Date: Fri, 21 Sep 2012 14:00:34 +0000 Subject: RAII-style dll management 1: Replaced autoptr and release with virtual destructors git-svn-id: svn+ssh://svn.code.sf.net/p/facetracknoir/code@155 19e81ba0-9b1a-49c3-bd6c-561e1906d5fb --- FaceTrackNoIR/FaceTrackNoIR.h | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) (limited to 'FaceTrackNoIR/FaceTrackNoIR.h') diff --git a/FaceTrackNoIR/FaceTrackNoIR.h b/FaceTrackNoIR/FaceTrackNoIR.h index d2b9cdde..e3cf798e 100644 --- a/FaceTrackNoIR/FaceTrackNoIR.h +++ b/FaceTrackNoIR/FaceTrackNoIR.h @@ -42,26 +42,16 @@ #include "ui_FTNoIR_Preferences.h" #include "ui_FTNoIR_Curves.h" -// #include "..\ftnoir_protocol_base\FTNoIR_Protocol_base.h" #include "..\ftnoir_tracker_base\FTNoIR_Tracker_base.h" #include "..\ftnoir_filter_base\FTNoIR_Filter_base.h" -#include "AutoClosePtr.h" -// 1a. COM-Like usage with smart pointer. -// No need to call `ITracker::Release'; the instance will -// be released automatically in destructor of the smart pointer. -//typedef AutoClosePtr ITrackerDialogPtr; -typedef ITrackerDialog *(WINAPI *importGetTrackerDialog)(void); -typedef ITrackerDll *(WINAPI *importGetTrackerDll)(void); - -typedef AutoClosePtr IProtocolDialogPtr; -typedef IProtocolDialog *(WINAPI *importGetProtocolDialog)(void); -typedef AutoClosePtr IFilterDialogPtr; -typedef IFilterDialog *(WINAPI *importGetFilterDialog)(void); - -typedef AutoClosePtr IFilterDllPtr; -typedef IFilterDll *(WINAPI *importGetFilterDll)(void); +typedef ITrackerDialogPtr (WINAPI *importGetTrackerDialog)(void); +typedef ITrackerDllPtr (WINAPI *importGetTrackerDll)(void); +typedef IProtocolDialogPtr (WINAPI *importGetProtocolDialog)(void); +//typedef IProtocolDllPtr (WINAPI *importGetProtocolDll)(void); +typedef IFilterDialogPtr (WINAPI *importGetFilterDialog)(void); +typedef IFilterDllPtr (WINAPI *importGetFilterDll)(void); #include @@ -93,7 +83,7 @@ private: QStringList filterFileList; // List of Filter-DLL-files, that are present in the program-folder QStringList trackerFileList; // List of Tracker-DLL-files, that are present in the program-folder - ITrackerDialog *pTrackerDialog; // Pointer to Tracker dialog instance (in DLL) + ITrackerDialogPtr pTrackerDialog; // Pointer to Tracker dialog instance (in DLL) IProtocolDialogPtr pProtocolDialog; // Pointer to Protocol dialog instance (in DLL) IFilterDialogPtr pFilterDialog; // Pointer to Filter dialog instance (in DLL) -- cgit v1.2.3