Skip to content
  • Ole John's avatar
    6bd21791
    Bug#23623251 API MEMORY LEAKS AFTER DESTRUCTING A NDB OBJECT WITH OPEN NDBTRANSACTIONS · 6bd21791
    Ole John authored
    Destruction of a Ndb object did not always release the memory used
    by Ndb<foo>Operations, and other similar objects, allocated by
    NdbTranactions still being open when the owning Ndb object is destructed.
    
    As all NdbTransactions are disconnected and the NdbTransaction objects freed
    when the Ndb is destructed, all API objects belonging to these NdbTransactions
    also becommes void.
    
    This patch ensures that Ndb::doDisconnect() (Called by Ndb d'tor)
    releases all API objects owned by its still remaing 'theTransactionList'
    
    Furthermore, it also fixes an issue where a async prepared NdbTransaction
    (NdbTransaction::theListState == InPreparedList) could be closed without
    ever being executed. That caused NdbTransaction::release() to abort due
    to this state not being expected.
    
    Fixes some obvoius incorrect comments releated to code paths relevant for
    this patch, and a likely merge problem where a copy of the decl of
     ::set- / ::getBuddyConPtr() had been pasted into another comment block.
    
    Added a new test case to prove the leaks plugged by this patch.
    Leaks will hit an assert in Ndb_free_list template when run
    without patch.
    6bd21791
    Bug#23623251 API MEMORY LEAKS AFTER DESTRUCTING A NDB OBJECT WITH OPEN NDBTRANSACTIONS
    Ole John authored
    Destruction of a Ndb object did not always release the memory used
    by Ndb<foo>Operations, and other similar objects, allocated by
    NdbTranactions still being open when the owning Ndb object is destructed.
    
    As all NdbTransactions are disconnected and the NdbTransaction objects freed
    when the Ndb is destructed, all API objects belonging to these NdbTransactions
    also becommes void.
    
    This patch ensures that Ndb::doDisconnect() (Called by Ndb d'tor)
    releases all API objects owned by its still remaing 'theTransactionList'
    
    Furthermore, it also fixes an issue where a async prepared NdbTransaction
    (NdbTransaction::theListState == InPreparedList) could be closed without
    ever being executed. That caused NdbTransaction::release() to abort due
    to this state not being expected.
    
    Fixes some obvoius incorrect comments releated to code paths relevant for
    this patch, and a likely merge problem where a copy of the decl of
     ::set- / ::getBuddyConPtr() had been pasted into another comment block.
    
    Added a new test case to prove the leaks plugged by this patch.
    Leaks will hit an assert in Ndb_free_list template when run
    without patch.
Loading