From 2afcd778748bb7d6fe489982c864b83d117a346b Mon Sep 17 00:00:00 2001 From: David Cermak Date: Wed, 29 Jul 2020 10:18:34 +0200 Subject: [PATCH] examples: Common connect component: Unregister shutdown handler on disconnection To be able to connect smoothly after disconnecting, we have to unregister all handlers including shutdown handler on disconnection --- examples/common_components/protocol_examples_common/connect.c | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/common_components/protocol_examples_common/connect.c b/examples/common_components/protocol_examples_common/connect.c index 9713edda2c..ceddf97d20 100644 --- a/examples/common_components/protocol_examples_common/connect.c +++ b/examples/common_components/protocol_examples_common/connect.c @@ -105,6 +105,7 @@ esp_err_t example_disconnect(void) stop(); ESP_LOGI(TAG, "Disconnected from %s", s_connection_name); s_connection_name = NULL; + ESP_ERROR_CHECK(esp_unregister_shutdown_handler(&stop)); return ESP_OK; }