+ BT_ASSERT(!notification->cc_prio_map);
+ notification->cc_prio_map = cc_prio_map;
+ bt_object_get_no_null_check_no_parent_check(
+ ¬ification->cc_prio_map->base);
+ BT_ASSERT(!notification->event);
+ notification->event = event;
+ BT_LOGD_STR("Freezing event notification's clock class priority map.");
+ bt_clock_class_priority_map_freeze(notification->cc_prio_map);
+ BT_LOGD("Created event notification object: "
+ "event-addr=%p, event-class-addr=%p, "
+ "event-class-name=\"%s\", event-class-id=%" PRId64 ", "
+ "cc-prio-map-addr=%p, notif-addr=%p",
+ notification->event, event_class,
+ bt_event_class_get_name(event_class),
+ bt_event_class_get_id(event_class), cc_prio_map,
+ notification);
+ goto end;
+
+error:
+ BT_ASSERT(!notification);
+ bt_event_destroy(event);
+
+end:
+ return (void *) notification;
+}
+
+BT_HIDDEN
+void bt_notification_event_destroy(struct bt_notification *notif)
+{
+ struct bt_notification_event *event_notif = (void *) notif;
+
+ BT_LOGD("Destroying event notification: addr=%p", notif);
+
+ if (event_notif->event) {
+ BT_LOGD_STR("Recycling event.");
+ bt_event_recycle(event_notif->event);