InProcClientWrapper::stop() throws an exception when stack
is already stopped. Not catching this exception would terminate
application.
Change-Id: I50bb6befb716049da275c16a4fdbf96437c2ad03
Signed-off-by: Harry <h.marappa@samsung.com>
Signed-off-by: jihwan.seo <jihwan.seo@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/15169
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Jaehong Jo <jaehong.jo@samsung.com>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
InProcClientWrapper::~InProcClientWrapper()
{
- stop();
+ try
+ {
+ stop();
+ }
+ catch (InitializeException &e)
+ {
+ oclog() << "Exception in stop"<< e.what() << std::flush;
+ }
}
OCStackResult InProcClientWrapper::start()
OCStackResult result = OCStop();
if (OC_STACK_OK != result)
- {
+ {
throw InitializeException(OC::InitException::STACK_TERMINATE_ERROR, result);
- }
+ }
}
return OC_STACK_OK;
}
OCStackResult res = OCStop();
- return res;
+ if (OC_STACK_OK != res)
+ {
+ throw InitializeException(OC::InitException::STACK_TERMINATE_ERROR, res);
+ }
+
+ return OC_STACK_OK;
}
void InProcServerWrapper::processFunc()
InProcServerWrapper::~InProcServerWrapper()
{
- stop();
+ try
+ {
+ stop();
+ }
+ catch (InitializeException &e)
+ {
+ oclog() << "Exception in stop"<< e.what() << std::flush;
+ }
}
}