Skip to content
This repository was archived by the owner on Apr 24, 2019. It is now read-only.

Fix for IOTCLT-961 #30

Merged
merged 2 commits into from
Aug 23, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions source/m2mconnectionhandlerpimpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ M2MConnectionHandlerPimpl::M2MConnectionHandlerPimpl(M2MConnectionHandler* base,
M2MConnectionHandlerPimpl::~M2MConnectionHandlerPimpl()
{
tr_debug("M2MConnectionHandlerPimpl::~M2MConnectionHandlerPimpl()");
if(_socket_address) {
delete _socket_address;
_socket_address = NULL;
}
if (_socket) {
delete _socket;
_socket = 0;
Expand Down Expand Up @@ -162,6 +166,10 @@ bool M2MConnectionHandlerPimpl::resolve_server_address(const String& server_addr
void M2MConnectionHandlerPimpl::dns_handler()
{
tr_debug("M2MConnectionHandlerPimpl::dns_handler()");
if(_socket_address) {
delete _socket_address;
_socket_address = NULL;
}
_socket_address = new SocketAddress(_net_iface,_server_address.c_str(), _server_port);
if(*_socket_address) {
_address._address = (void*)_socket_address->get_ip_address();
Expand Down