forked from espressif/esp-idf
modbus: fix tcp slave destroy issues
Closes https://github.com/espressif/esp-idf/issues/8211
This commit is contained in:
@ -119,7 +119,7 @@ static esp_err_t mbc_tcp_slave_destroy(void)
|
|||||||
(void)vQueueDelete(mbs_opts->mbs_notification_queue_handle);
|
(void)vQueueDelete(mbs_opts->mbs_notification_queue_handle);
|
||||||
(void)vEventGroupDelete(mbs_opts->mbs_event_group);
|
(void)vEventGroupDelete(mbs_opts->mbs_event_group);
|
||||||
(void)vMBTCPPortClose();
|
(void)vMBTCPPortClose();
|
||||||
|
mbs_interface_ptr = NULL;
|
||||||
vMBPortSetMode((UCHAR)MB_PORT_INACTIVE);
|
vMBPortSetMode((UCHAR)MB_PORT_INACTIVE);
|
||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
|
@ -654,6 +654,7 @@ vMBTCPPortDisable( void )
|
|||||||
xConfig.pxMbClientInfo[i] = NULL;
|
xConfig.pxMbClientInfo[i] = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
free(xConfig.pxMbClientInfo);
|
||||||
close(xListenSock);
|
close(xListenSock);
|
||||||
xListenSock = -1;
|
xListenSock = -1;
|
||||||
vMBTCPPortRespQueueDelete(xConfig.xRespQueueHandle);
|
vMBTCPPortRespQueueDelete(xConfig.xRespQueueHandle);
|
||||||
|
Reference in New Issue
Block a user