Skip to content

Commit

Permalink
Releasing reader_ memory for KSyncSockTcpSession.
Browse files Browse the repository at this point in the history
Change-Id: Ica7c732b1e7a8ca730147daf0cd10dd47ebf8858
Partial-Bug: #1735174
  • Loading branch information
esnagendra committed Aug 13, 2018
1 parent da2671b commit 69381c6
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
Original file line number Diff line number Diff line change
Expand Up @@ -968,6 +968,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
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,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 69381c6

Please sign in to comment.