[
https://issues.apache.org/jira/browse/PROTON-1691?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16264587#comment-16264587
]
Cliff Jansen commented on PROTON-1691:
--------------------------------------
In theory pn_free(link->context) should result in
pn_record_finalize(link->context)
which does the same thing as your proposed pn_record_clear().
I think the correct fix is to hunt down who has a rogue (or circular) reference
to link->context and keeping it alive.
If you are pretty sure it is not your handler, attach a test program to this
JIRA and I'll try chasing it down.
> 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]