in the file cassandra_factory.cc , in the function.....
CassandraClient *CassandraFactory::createThriftClient(const string &in_host,
int in_port,
bool framed_transport)
In this function the open is called after the pointer to CassandraClient is created. Any exception in open causes the CassandraClient pointer to be lost resulting in a memory leak. Not being able to connect to an endpoint throws the thrift TTransport exception which therefore results in a memory leak that I am seeing.
Reversing the order like so solves the problem...
transport->open(); /* throws an exception */
CassandraClient *client= new(std::nothrow) CassandraClient(protocol);
This has been tested to work.
Thanks.
-- Sandeep
in the file cassandra_factory.cc , in the function.....
CassandraClient *CassandraFactory::createThriftClient(const string &in_host,
int in_port,
bool framed_transport)
In this function the open is called after the pointer to CassandraClient is created. Any exception in open causes the CassandraClient pointer to be lost resulting in a memory leak. Not being able to connect to an endpoint throws the thrift TTransport exception which therefore results in a memory leak that I am seeing.
Reversing the order like so solves the problem...
transport->open(); /* throws an exception */
CassandraClient *client= new(std::nothrow) CassandraClient(protocol);
This has been tested to work.
Thanks.
-- Sandeep