Skip to content

Commit

Permalink
Releasing reader_ memory for KSyncSockTcpSession.
Browse files Browse the repository at this point in the history
Change-Id: Ic773d0a5531ab0d327d28eacf58beb3e9f52aa2f
Partial-Bug: #1735174
  • Loading branch information
esnagendra committed Aug 13, 2018
1 parent 23b959f commit 7ca4873
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/ksync/ksync_sock.cc
Expand Up @@ -969,6 +969,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
1 change: 1 addition & 0 deletions src/ksync/ksync_sock.h
Expand Up @@ -536,6 +536,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

0 comments on commit 7ca4873

Please sign in to comment.