Skip to content

Commit

Permalink
modbus: fix tcp slave destroy issues
Browse files Browse the repository at this point in the history
Closes #8211
  • Loading branch information
aleks authored and alisitsyn committed Mar 8, 2022
1 parent 9338d1d commit 106fcdc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ static esp_err_t mbc_tcp_slave_destroy(void)
(void)vQueueDelete(mbs_opts->mbs_notification_queue_handle);
(void)vEventGroupDelete(mbs_opts->mbs_event_group);
(void)vMBTCPPortClose();

mbs_interface_ptr = NULL;
vMBPortSetMode((UCHAR)MB_PORT_INACTIVE);
return ESP_OK;
}
Expand Down
1 change: 1 addition & 0 deletions components/freemodbus/tcp_slave/port/port_tcp_slave.c
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,7 @@ vMBTCPPortDisable( void )
xConfig.pxMbClientInfo[i] = NULL;
}
}
free(xConfig.pxMbClientInfo);
close(xListenSock);
xListenSock = -1;
vMBTCPPortRespQueueDelete(xConfig.xRespQueueHandle);
Expand Down

0 comments on commit 106fcdc

Please sign in to comment.