From 46ad14b3fa7c9ddcafead5a8514d8f08db66a261 Mon Sep 17 00:00:00 2001 From: Yong Yeon Kim Date: Tue, 2 Apr 2013 13:55:30 +0900 Subject: [PATCH] fix prevent bugs --- packaging/libmedia-service.spec | 2 +- src/common/media-svc.c | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/packaging/libmedia-service.spec b/packaging/libmedia-service.spec index 87c1a8f..4592c82 100755 --- a/packaging/libmedia-service.spec +++ b/packaging/libmedia-service.spec @@ -1,6 +1,6 @@ Name: libmedia-service Summary: Media information service library for multimedia applications. -Version: 0.2.30 +Version: 0.2.31 Release: 1 Group: System/Libraries License: Apache License, Version 2.0 diff --git a/src/common/media-svc.c b/src/common/media-svc.c index ed4e60e..a95ccd7 100755 --- a/src/common/media-svc.c +++ b/src/common/media-svc.c @@ -735,7 +735,12 @@ int media_svc_delete_item_by_path(MediaSvcHandle *handle, const char *path) /*Delete item*/ ret = _media_svc_delete_item_by_path(db_handle, path); - media_svc_retv_if(ret != MEDIA_INFO_ERROR_NONE, ret); + if (ret != MEDIA_INFO_ERROR_NONE) { + media_svc_error("_media_svc_delete_item_by_path failed : %d", ret); + _media_svc_destroy_noti_item(noti_item); + + return ret; + } /* Send notification */ media_svc_debug("Deletion is successful. Sending noti for this"); @@ -912,10 +917,12 @@ int media_svc_refresh_item(MediaSvcHandle *handle, media_svc_storage_type_e stor if (ret == MEDIA_INFO_ERROR_NONE) { media_svc_debug("Update is successful. Sending noti for this"); _media_svc_publish_noti(MS_MEDIA_ITEM_FILE, MS_MEDIA_ITEM_UPDATE, content_info.path, media_type, noti_item->media_uuid, noti_item->mime_type); - _media_svc_destroy_noti_item(noti_item); + } else { + media_svc_error("_media_svc_update_item_with_data failed : %d", ret); } _media_svc_destroy_content_info(&content_info); + _media_svc_destroy_noti_item(noti_item); return ret; } -- 2.7.4