1 Reply Latest reply on Mar 24, 2016 9:12 PM by JeGu_2199941 Branched from an earlier discussion.

    Issue with MQTT reconnecting to broker if wifi connection goes down (con't)

      Hello VikramR_26

       

      As a follow on to this thread: Issue with MQTT reconnecting to broker if wifi connection goes down

       

      I'm also trying to make the same logic work. When disconnected, I deinit and free mqtt_object and do some other stuff. Then I recreate it and try to connect. However there seems to be a memory leak, I think it might be related with the linked list that the session creates. Is there a way to easily delete all the data related to mqtt connection? Here is the code I used for deinit :

       

        mqtt_connection_t *conn = (mqtt_connection_t*) mqtt_object;

        wiced_rtos_deregister_timed_event( &conn->heartbeat.timer );

        mqtt_connection_deinit(conn);

        wiced_mqtt_deinit(mqtt_object);

        free( mqtt_object );

       

      Thanks