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
This commit is contained in:
David Cermak 2020-07-29 10:18:34 +02:00
parent 12e86a7c1b
commit 2afcd77874

View File

@ -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;
}