Update sample code in document 08/222908/4
authormk5004.lee <mk5004.lee@samsung.com>
Tue, 21 Jan 2020 09:17:53 +0000 (18:17 +0900)
committermk5004.lee <mk5004.lee@samsung.com>
Wed, 22 Jan 2020 01:24:30 +0000 (10:24 +0900)
 - item_destroy after noti_ex_item_group_add_child

Change-Id: I18c9fccefe99ff034abd499ce881d93d3dc6c38a
Signed-off-by: mk5004.lee <mk5004.lee@samsung.com>
notification-ex/api/notification_ex_group.h
notification-ex/api/notification_ex_internal.h
notification-ex/api/notification_ex_item.h
notification-ex/api/notification_ex_reporter.h

index 5ecc9fb..0b5aa11 100644 (file)
@@ -157,6 +157,8 @@ int noti_ex_item_group_get_app_label(noti_ex_item_h handle, char **label);
        ret = noti_ex_item_group_create(&group_item, "group_id");
        ret = noti_ex_item_button_create(&child_item, "button_id", "button_title");
        ret = noti_ex_item_group_add_child(group_item, child_item);
+
+       noti_ex_item_destroy(child_item);
 }
  * @endcode
  */
@@ -229,6 +231,8 @@ int _ex_item_group_foreach_child_cb(noti_ex_item_h handle, void *user_data) {
        ret = noti_ex_item_button_create(&child_item, "button_id", "button_title");
        ret = noti_ex_item_group_add_child(group_item, child_item);
 
+       noti_ex_item_destroy(child_item);
+
        ret = noti_ex_item_group_foreach_child(group_item, _ex_item_group_foreach_child_cb, NULL);
 }
  * @endcode
index eda78a1..35c4d5a 100644 (file)
@@ -23,21 +23,19 @@ extern "C" {
 
 int noti_ex_item_free_string_list(char** list, int count);
 int noti_ex_item_group_remove_children(noti_ex_item_h handle);
-int noti_ex_item_time_set_time(noti_ex_item_h handle,
-        time_t time);
+int noti_ex_item_time_set_time(noti_ex_item_h handle, time_t time);
 
-int noti_ex_style_set_geometry(
-    noti_ex_style_h handle, noti_ex_geometry_h geometry);
-int noti_ex_style_set_color(
-    noti_ex_style_h handle, noti_ex_color_h color);
+int noti_ex_style_set_geometry(noti_ex_style_h handle,
+               noti_ex_geometry_h geometry);
+int noti_ex_style_set_color(noti_ex_style_h handle, noti_ex_color_h color);
 int noti_ex_style_set_padding(noti_ex_style_h handle,
-    noti_ex_padding_h padding);
+               noti_ex_padding_h padding);
 
-int noti_ex_led_info_set_color(
-    noti_ex_led_info_h handle, noti_ex_color_h color);
+int noti_ex_led_info_set_color(noti_ex_led_info_h handle,
+               noti_ex_color_h color);
 
 
 #ifdef __cplusplus
 }
 #endif
-#endif  /* __TIZEN_APPFW_NOTIFICATION_EX_INTERNAL_H__ */
\ No newline at end of file
+#endif  /* __TIZEN_APPFW_NOTIFICATION_EX_INTERNAL_H__ */
index b45cd8a..8cb3034 100644 (file)
@@ -2195,6 +2195,7 @@ int noti_ex_item_get_main_type(noti_ex_item_h handle, int *type);
        ret = noti_ex_item_group_create(&group_item, "group_id");
        ret = noti_ex_item_text_create(&text_item, "text_id", "text", "hyperlink");
        ret = noti_ex_item_group_add_child(group_item, text_item);
+       noti_ex_item_destroy(text_item);
 
        ret = noti_ex_item_set_main_type(group_item, "text_id", type);
 }
index f0fb401..908d653 100644 (file)
@@ -242,7 +242,10 @@ void _reporter_events_error_cb(noti_ex_reporter_h handle, noti_ex_error_e error,
        ret = noti_ex_item_group_create(&group_item, "group_id");
        ret = noti_ex_item_button_create(&child_item, "button_id", "button_title");
        ret = noti_ex_item_group_add_child(group_item, child_item);
+       noti_ex_item_destroy(child_item);
+
        ret = noti_ex_reporter_post(handle, group_item, &request_id);
+       noti_ex_item_destroy(group_item);
 }
  * @endcode
  */
@@ -286,12 +289,18 @@ void _reporter_events_error_cb(noti_ex_reporter_h handle, noti_ex_error_e error,
        ret = noti_ex_item_group_create(&noti_list[0], "group_id1");
        ret = noti_ex_item_button_create(&child_item, "button_id1", "button_title");
        ret = noti_ex_item_group_add_child(noti_list[0], child_item);
+       noti_ex_item_destroy(child_item);
 
        ret = noti_ex_item_group_create(&noti_list[1], "group_id2");
        ret = noti_ex_item_button_create(&child_item, "button_id2", "button_title");
        ret = noti_ex_item_group_add_child(noti_list[1], child_item);
+       noti_ex_item_destroy(child_item);
 
        ret = noti_ex_reporter_post_list(handle, noti_list, 2, &request_id);
+       noti_ex_item_destroy(noti_list[0]);
+       noti_ex_item_destroy(noti_list[1]);
+
+       free(noti_list);
 }
  * @endcode
  */