MvFaceDetection::~MvFaceDetection()
{
- mv_face_detection_destroy(_handle);
+ try {
+ int ret = mv_face_detection_destroy(_handle);
+ if (ret != MEDIA_VISION_ERROR_NONE)
+ SINGLEO_LOGE("Fail to destroy face detection handle.(%d)", ret);
+ } catch (const runtime_error &e) {
+ SINGLEO_LOGE("Failed to destroy face detection handle: %s", e.what());
+ throw runtime_error("Failed to destroy face detection handle.");
+ }
}
void MvFaceDetection::configure()
MvFaceLandmark::~MvFaceLandmark()
{
- mv_facial_landmark_destroy(_handle);
+ try {
+ int ret = mv_facial_landmark_destroy(_handle);
+ if (ret != MEDIA_VISION_ERROR_NONE)
+ SINGLEO_LOGE("Fail to destroy facial landmark handle.(%d)", ret);
+ } catch (const std::runtime_error &e) {
+ SINGLEO_LOGE("Failed to destroy facial landmark handle: %s", e.what());
+ throw runtime_error("Failed to destroy facial landmark handle.");
+ }
}
void MvFaceLandmark::configure()
MvFaceRecognition::~MvFaceRecognition()
{
- mv_face_recognition_destroy(_handle);
+ try {
+ int ret = mv_face_recognition_destroy(_handle);
+ if (ret != MEDIA_VISION_ERROR_NONE)
+ SINGLEO_LOGE("Fail to destroy face recognition handle.(%d)", ret);
+ } catch (const std::runtime_error &e) {
+ SINGLEO_LOGE("Failed to destroy face recognition handle: %s", e.what());
+ throw runtime_error("Failed to destroy face recognition handle.");
+ }
}
void MvFaceRecognition::configure()
MvImageClassification::~MvImageClassification()
{
- mv_image_classification_destroy(_handle);
+ try {
+ int ret = mv_image_classification_destroy(_handle);
+ if (ret != MEDIA_VISION_ERROR_NONE)
+ SINGLEO_LOGE("Fail to destroy image classification handle.(%d)", ret);
+ } catch (const std::runtime_error &e) {
+ SINGLEO_LOGE("Failed to destroy image classification handle: %s", e.what());
+ throw runtime_error("Failed to destroy image classification handle.");
+ }
}
void MvImageClassification::configure()
MvObjectDetection::~MvObjectDetection()
{
- mv_object_detection_destroy(_handle);
+ try {
+ int ret = mv_object_detection_destroy(_handle);
+ if (ret != MEDIA_VISION_ERROR_NONE)
+ SINGLEO_LOGE("Fail to destroy object detection handle.(%d)", ret);
+ } catch (const std::runtime_error &e) {
+ SINGLEO_LOGE("Failed to destroy object detection handle: %s", e.what());
+ throw runtime_error("Failed to destroy object detection handle.");
+ }
}
void MvObjectDetection::configure()