event_base memory freeing by class TNonblockingServer
-----------------------------------------------------
Key: THRIFT-1184
URL: https://issues.apache.org/jira/browse/THRIFT-1184
Project: Thrift
Issue Type: Bug
Components: C++ - Library
Reporter: Pavlin Radoslavov
The TNonblockingServer::eventBase_ pointer is assigned
by method TNonblockingServer::registerEvents()
so the libevent events are added to the proper libevent event base.
Currently the TNonblockingServer destructor unconditionally
calls event_base_free(eventBase_) to free the eventBase_ memory.
In certain cases the libevent event base might be allocated and
deallocated by a third-party software that uses Thrift, so it is
not appropriate for the TNonblockingServer destructor to unconditionally
call event_base_free(eventBase_).
Please see attached patch for a possible solution:
add an optional bool argument to method TNonblockingServer::registerEvents():
the value of that flag controls whether the TNonblockingServer destructor
should call event_base_free(eventBase_).
The argument is optional, and defaults to true (i.e, event_base_free(eventBase_)
is called) for API (and behavior) backward compatibility.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira