[ https://issues.apache.org/jira/browse/THRIFT-1184?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13055730#comment-13055730 ]
Nevo Hed commented on THRIFT-1184: ---------------------------------- +1 I think the feature of running TNonBlocking on an existing event_base is an important one, if there are any users that run this in a scenario that is not run-forever then this would be a show-stopper for them > 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 > Labels: libevent > Attachments: thrift1184_eventbase_free.patch > > > 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