diff options
Diffstat (limited to 'AudioManagerUtilities/src/CAmCommonAPIWrapper.cpp')
-rw-r--r-- | AudioManagerUtilities/src/CAmCommonAPIWrapper.cpp | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/AudioManagerUtilities/src/CAmCommonAPIWrapper.cpp b/AudioManagerUtilities/src/CAmCommonAPIWrapper.cpp index e756c19..8d2b82e 100644 --- a/AudioManagerUtilities/src/CAmCommonAPIWrapper.cpp +++ b/AudioManagerUtilities/src/CAmCommonAPIWrapper.cpp @@ -15,7 +15,7 @@ * For further information see http://www.genivi.org/. */ -#include <audiomanagerconfig.h> +#include "audiomanagerconfig.h" #include <fstream> #include <sstream> #include <algorithm> @@ -80,17 +80,6 @@ CAmCommonAPIWrapper::~CAmCommonAPIWrapper() mContext.reset(); mpSocketHandler = NULL; mWatchToCheck = NULL; - try - { - if (pSingleCommonAPIInstance!=NULL) - delete pSingleCommonAPIInstance; - - pSingleCommonAPIInstance=NULL; - } - catch(...) - { - logError(__PRETTY_FUNCTION__,"error while deleting CAPIWrapper instance"); - } } CAmCommonAPIWrapper* CAmCommonAPIWrapper::instantiateOnce(CAmSocketHandler* socketHandler, const std::string & applicationName) @@ -107,6 +96,21 @@ CAmCommonAPIWrapper* CAmCommonAPIWrapper::instantiateOnce(CAmSocketHandler* sock return pSingleCommonAPIInstance; } +void CAmCommonAPIWrapper::deleteInstance() +{ + try + { + if (pSingleCommonAPIInstance!=NULL) + delete pSingleCommonAPIInstance; + + pSingleCommonAPIInstance=NULL; + } + catch(...) + { + logError(__PRETTY_FUNCTION__,"error while deleting CAPIWrapper instance"); + } +} + CAmCommonAPIWrapper* CAmCommonAPIWrapper::getInstance() { assert(NULL!=pSingleCommonAPIInstance); |