From 854271aef27ac85e8a0ea49a0739fedf463a85b9 Mon Sep 17 00:00:00 2001 From: Jeesun Kim Date: Thu, 13 Apr 2017 17:57:50 +0900 Subject: [PATCH] Fixed issue which view uri table is deleted Change-Id: I6282c006f4d1aee93075fc35a9e6d2f75cbc1762 --- common/cal_filter.c | 2 +- common/cal_query.c | 7 +++---- common/cal_record.c | 12 ++++++------ 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/common/cal_filter.c b/common/cal_filter.c index 3fc63d4..2abfbd8 100644 --- a/common/cal_filter.c +++ b/common/cal_filter.c @@ -42,13 +42,13 @@ EXPORT_API int calendar_filter_create(const char* view_uri, calendar_filter_h* o RETV_IF(NULL == view_uri, CALENDAR_ERROR_INVALID_PARAMETER); RETV_IF(NULL == out_filter, CALENDAR_ERROR_INVALID_PARAMETER); + com_filter = calloc(1, sizeof(cal_composite_filter_s)); RETV_IF(NULL == com_filter, CALENDAR_ERROR_OUT_OF_MEMORY); #ifdef CAL_IPC_CLIENT cal_view_initialize(); #endif - com_filter->filter_type = CAL_FILTER_COMPOSITE; com_filter->view_uri = cal_strdup(view_uri); com_filter->properties = (cal_property_info_s *)cal_view_get_property_info(view_uri, &com_filter->property_count); diff --git a/common/cal_query.c b/common/cal_query.c index 915f511..47d4f61 100644 --- a/common/cal_query.c +++ b/common/cal_query.c @@ -45,13 +45,12 @@ EXPORT_API int calendar_query_create(const char* view_uri, calendar_query_h* out RETV_IF(NULL == view_uri, CALENDAR_ERROR_INVALID_PARAMETER); RETV_IF(NULL == out_query, CALENDAR_ERROR_INVALID_PARAMETER); -#ifdef CAL_IPC_CLIENT - cal_view_initialize(); -#endif - query = calloc(1, sizeof(cal_query_s)); RETV_IF(NULL == query, CALENDAR_ERROR_OUT_OF_MEMORY); +#ifdef CAL_IPC_CLIENT + cal_view_initialize(); +#endif query->view_uri = cal_strdup(view_uri); query->properties = (cal_property_info_s *)cal_view_get_property_info(view_uri, &query->property_count); *out_query = (calendar_query_h)query; diff --git a/common/cal_record.c b/common/cal_record.c index ceafc7a..700823a 100644 --- a/common/cal_record.c +++ b/common/cal_record.c @@ -178,7 +178,6 @@ EXPORT_API int calendar_record_create(const char* view_uri, calendar_record_h* o #ifdef CAL_IPC_CLIENT cal_view_initialize(); #endif - type = cal_view_get_type(view_uri); RETV_IF(CAL_RECORD_TYPE_INVALID == type, CALENDAR_ERROR_INVALID_PARAMETER); @@ -187,7 +186,6 @@ EXPORT_API int calendar_record_create(const char* view_uri, calendar_record_h* o RETVM_IF(NULL == plugin_cb->create, CALENDAR_ERROR_NOT_PERMITTED, "Not permitted in [%s]", view_uri); ret = plugin_cb->create(out_record); - if (CALENDAR_ERROR_NONE == ret) CAL_RECORD_INIT_COMMON((cal_record_s*)*out_record, type, plugin_cb, cal_view_get_uri(view_uri)); @@ -200,10 +198,6 @@ EXPORT_API int calendar_record_destroy(calendar_record_h record, bool delete_chi RETV_IF(NULL == record, CALENDAR_ERROR_INVALID_PARAMETER); -#ifdef CAL_IPC_CLIENT - cal_view_finalize(); -#endif - cal_record_s *temp = (cal_record_s*)(record); RETV_IF(NULL == temp->plugin_cb, CALENDAR_ERROR_INVALID_PARAMETER); @@ -211,6 +205,9 @@ EXPORT_API int calendar_record_destroy(calendar_record_h record, bool delete_chi CAL_FREE(temp->properties_flags); +#ifdef CAL_IPC_CLIENT + cal_view_finalize(); +#endif ret = temp->plugin_cb->destroy(record, delete_child); return ret; @@ -227,6 +224,9 @@ EXPORT_API int calendar_record_clone(calendar_record_h record, calendar_record_h RETV_IF(NULL == out_record, CALENDAR_ERROR_INVALID_PARAMETER); RETVM_IF(NULL == temp->plugin_cb->clone, CALENDAR_ERROR_NOT_PERMITTED, "Not permitted in [%s]", temp->view_uri); +#ifdef CAL_IPC_CLIENT + cal_view_initialize(); +#endif ret = temp->plugin_cb->clone(record, out_record); return ret; -- 2.7.4