The capi function 'sensor_destroy_listener' can throw
std::invalid_argument but this function can be used in C(which cannot
handle thrown exceptions) so a try-catch statement is added to handle
this exception.
This patch will solve the SVACE report with WGID 203810.
Change-Id: I5eda70a6afb62f63c823df6f96c73271872def4d
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
if (listener->magic != SENSOR_LISTENER_MAGIC)
return SENSOR_ERROR_INVALID_PARAMETER;
- sensord_disconnect(listener->id);
+ try {
+ sensord_disconnect(listener->id);
+ } catch (std::invalid_argument &e) {
+ _E("sensord_disconnect failed: %s", e.what());
+ return SENSOR_ERROR_INVALID_PARAMETER;
+ }
+
listener->magic = 0;
delete (sensor_listener_s *)listener;