/// @brief Construct a socket by moving an existing one.
socketcan_t::socketcan_t(socketcan_t&& s)
: socket_{s.socket_}
- {}
+ {
+ ::memset(&tx_address_, 0, sizeof(tx_address_));
+ }
socketcan_t& socketcan_t::operator=(const socketcan_t& s)
{
}
socketcan_t::~socketcan_t()
- {}
+ {
+ close();
+ socket_ = INVALID_SOCKET;
+ }
const struct sockaddr_can& socketcan_t::get_tx_address() const
{