Skip to content

Commit 21e9858

Browse files
committed
Merge branch 'bugfix/ppp_netif_free' into 'master'
esp-modem: Remove esp-netif destroy from modem network glue code Closes IDFGH-3534 See merge request espressif/esp-idf!9471
2 parents 94cc8fc + 6f1b8fe commit 21e9858

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

examples/protocols/pppos_client/components/modem/src/esp_modem_netif.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ void *esp_modem_netif_setup(modem_dte_t *dte)
109109
void esp_modem_netif_teardown(void *h)
110110
{
111111
esp_modem_netif_driver_t *driver = h;
112-
esp_netif_destroy(driver->base.netif);
113112
free(driver);
114113
}
115114

examples/protocols/pppos_client/main/pppos_client_main.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,8 +320,10 @@ void app_main(void)
320320
vTaskDelay(pdMS_TO_TICKS(60000));
321321
}
322322

323-
/* Destroy the netif adapter withe events, which internally frees also the esp-netif instance */
323+
/* Unregister events, destroy the netif adapter and destroy its esp-netif instance */
324324
esp_modem_netif_clear_default_handlers(modem_netif_adapter);
325325
esp_modem_netif_teardown(modem_netif_adapter);
326+
esp_netif_destroy(esp_netif);
327+
326328
ESP_ERROR_CHECK(dte->deinit(dte));
327329
}

tools/test_apps/protocols/pppos/main/pppos_client_main.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,9 +258,11 @@ void app_main(void)
258258
ESP_ERROR_CHECK(esp_modem_stop_ppp(dte));
259259
/* Wait for the PPP connection to terminate gracefully */
260260
xEventGroupWaitBits(event_group, DISCONNECT_BIT, pdTRUE, pdTRUE, portMAX_DELAY);
261-
/* Destroy the netif adapter withe events, which internally frees also the esp-netif instance */
261+
/* Unregister events, destroy the netif adapter and destroy its esp-netif instance */
262262
esp_modem_netif_clear_default_handlers(modem_netif_adapter);
263263
esp_modem_netif_teardown(modem_netif_adapter);
264+
esp_netif_destroy(esp_netif);
265+
264266
xEventGroupWaitBits(event_group, STOP_BIT, pdTRUE, pdTRUE, portMAX_DELAY);
265267
ESP_ERROR_CHECK(dce->deinit(dce));
266268
ESP_ERROR_CHECK(dte->deinit(dte));

0 commit comments

Comments
 (0)