Example #1
0
static kaa_error_t kaa_context_destroy(kaa_context_t *context)
{
    KAA_RETURN_IF_NIL(context, KAA_ERR_BADPARAM);

    kaa_user_manager_destroy(context->user_manager);
#ifndef KAA_DISABLE_FEATURE_EVENTS
    kaa_event_manager_destroy(context->event_manager);
#endif
    kaa_profile_manager_destroy(context->profile_manager);
    kaa_bootstrap_manager_destroy(context->bootstrap_manager);
    kaa_channel_manager_destroy(context->channel_manager);
    kaa_status_destroy(context->status->status_instance);
    kaa_failover_strategy_destroy(context->failover_strategy);
    KAA_FREE(context->status);
#ifndef KAA_DISABLE_FEATURE_LOGGING
    kaa_log_collector_destroy(context->log_collector);
#endif
#ifndef KAA_DISABLE_FEATURE_CONFIGURATION
    kaa_configuration_manager_destroy(context->configuration_manager);
#endif
#ifndef KAA_DISABLE_FEATURE_NOTIFICATION
    kaa_notification_manager_destroy(context->notification_manager);
#endif
    kaa_platform_protocol_destroy(context->platform_protocol);
    KAA_FREE(context);
    return KAA_ERR_NONE;
}
Example #2
0
int test_deinit(void)
{
#ifndef KAA_DISABLE_FEATURE_CONFIGURATION
    kaa_status_destroy(status);
    kaa_configuration_manager_destroy(config_manager);
#endif
    kaa_log_destroy(logger);

    return 0;
}