Skip to content

Commit ccdd0c5

Browse files
committed
Merge pull request #29 from pkwong4321/master
Skip LOG in ping, fix heap error, fix #30
2 parents 71f49fa + 669a475 commit ccdd0c5

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/internal/sio_client_impl.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,8 @@ namespace sio
273273
{
274274
if(ec || m_con.expired())
275275
{
276-
LOG("ping exit,con is expired?"<<m_con.expired()<<",ec:"<<ec.message()<<endl);
276+
if (ec != boost::asio::error::operation_aborted)
277+
LOG("ping exit,con is expired?"<<m_con.expired()<<",ec:"<<ec.message()<<endl);
277278
return;
278279
}
279280
packet p(packet::frame_ping);

src/sio_socket.cpp

+5-3
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,9 @@ namespace sio
316316
void socket::impl::on_close()
317317
{
318318
NULL_GUARD(m_client);
319+
sio::client_impl *client = m_client;
320+
m_client = NULL;
321+
319322
if(m_connection_timer)
320323
{
321324
m_connection_timer->cancel();
@@ -325,9 +328,8 @@ namespace sio
325328
while (!m_packet_queue.empty()) {
326329
m_packet_queue.pop();
327330
}
328-
m_client->on_socket_closed(m_nsp);
329-
m_client->remove_socket(m_nsp);
330-
m_client = NULL;
331+
client->on_socket_closed(m_nsp);
332+
client->remove_socket(m_nsp);
331333
}
332334

333335
void socket::impl::on_open()

0 commit comments

Comments
 (0)