Xin Chen created PROTON-1691:
--------------------------------

             Summary: Memory leak when creating endpoint objects with a handler
                 Key: PROTON-1691
                 URL: https://issues.apache.org/jira/browse/PROTON-1691
             Project: Qpid Proton
          Issue Type: Bug
          Components: proton-c
    Affects Versions: proton-c-0.18.1
         Environment: Reproduced on Windows but the code is not platform 
specific.
            Reporter: Xin Chen


Using the Python binding, one can provide a handler when creating an Endpoint 
object (Connection/Session/Link). This handler object is set in the record 
context. In pn_###_finalize methods, the context is not cleared by calling 
pn_record_clear. This results in a _cadapter object leaking in Python process 
without any references. The fix is simply to call pn_record_clear before 
freeing the context. For example, in pn_link_finalize (line 1121 in engine.c),

+  pn_record_clear(link->context);
  pn_free(link->context);

With this fix the memory does not grow anymore with repeated link 
creation/closing. I only use a handler in link endpoint but I think this is 
needed for connection and session as well.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to