Skip to content

Commit

Permalink
Releasing reader_ memory for KSyncSockTcpSession.
Browse files Browse the repository at this point in the history
Change-Id: Ic37b941a36d880e96616ff787563f7c1fcb21531
Partial-Bug: #1735174
  • Loading branch information
esnagendra committed Jul 23, 2018
1 parent 6895c5c commit 1a6091a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/ksync/ksync_sock.h
Expand Up @@ -629,6 +629,7 @@ class KSyncSockTcpSession : public TcpSession {
public:
KSyncSockTcpSession(TcpServer *server, Socket *sock,
bool async_ready = false);
virtual ~KSyncSockTcpSession();
protected:
virtual void OnRead(Buffer buffer);
private:
Expand Down
6 changes: 6 additions & 0 deletions src/ksync/ksync_sock_tcp.cc
Expand Up @@ -296,6 +296,12 @@ KSyncSockTcpSession::KSyncSockTcpSession(TcpServer *server, Socket *sock,
boost::bind(&KSyncSockTcp::ReceiveMsg, tcp_ptr, _1, _2));
}

KSyncSockTcpSession::~KSyncSockTcpSession() {
if (reader_) {
delete reader_;
}
}

void KSyncSockTcpSession::OnRead(Buffer buffer) {
reader_->OnRead(buffer);
}
Expand Down

0 comments on commit 1a6091a

Please sign in to comment.