diff options
author | Christian.Linke <christian.linke@bmw.de> | 2015-12-15 05:42:04 -0800 |
---|---|---|
committer | Christian.Linke <christian.linke@bmw.de> | 2015-12-15 05:42:04 -0800 |
commit | 9455195e096ea5f9a82a358bf55b405029e13d2d (patch) | |
tree | 2ae4100f30d134cffcfd9118a154d43c1544b78d /AudioManagerUtilities | |
parent | 42d9413478b8a853aa7d52d3f54f608a932cf49a (diff) | |
download | audiomanager-9455195e096ea5f9a82a358bf55b405029e13d2d.tar.gz |
deleting of instance explicit is needed
Diffstat (limited to 'AudioManagerUtilities')
-rw-r--r-- | AudioManagerUtilities/include/CAmCommonAPIWrapper.h | 5 | ||||
-rw-r--r-- | AudioManagerUtilities/src/CAmCommonAPIWrapper.cpp | 28 |
2 files changed, 21 insertions, 12 deletions
diff --git a/AudioManagerUtilities/include/CAmCommonAPIWrapper.h b/AudioManagerUtilities/include/CAmCommonAPIWrapper.h index f2d701d..f9a6b01 100644 --- a/AudioManagerUtilities/include/CAmCommonAPIWrapper.h +++ b/AudioManagerUtilities/include/CAmCommonAPIWrapper.h @@ -113,6 +113,11 @@ public: static CAmCommonAPIWrapper* getInstance(); /** + * \brief Deletes the instanciated object + */ + static void deleteInstance(); + + /** * \brief Creates a singleton instance attached to the provided socket handler object. * * This method should be called only once because it instantiates a single object. 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); |