PROTON-1566: [C++ binding] fix minor thread safety issue in reconnect
Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/35191b8b Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/35191b8b Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/35191b8b Branch: refs/heads/go1 Commit: 35191b8b54d31c8e79d6921eb3927c6fc4fb3cda Parents: 17d2a6f Author: Alan Conway <[email protected]> Authored: Thu Aug 31 17:05:17 2017 -0400 Committer: Alan Conway <[email protected]> Committed: Thu Aug 31 17:05:17 2017 -0400 ---------------------------------------------------------------------- proton-c/bindings/cpp/src/proactor_container_impl.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/35191b8b/proton-c/bindings/cpp/src/proactor_container_impl.cpp ---------------------------------------------------------------------- diff --git a/proton-c/bindings/cpp/src/proactor_container_impl.cpp b/proton-c/bindings/cpp/src/proactor_container_impl.cpp index 7f5edfe..43460db 100644 --- a/proton-c/bindings/cpp/src/proactor_container_impl.cpp +++ b/proton-c/bindings/cpp/src/proactor_container_impl.cpp @@ -212,7 +212,9 @@ void container::impl::reconnect(pn_connection_t* pnc) { cc.connected_address_ = url; setup_connection_lh(url, pnc); - make_wrapper(pnc).open(*rc->connection_options_); + { // Scope required to keep temporary destructor from doing pn_decref() after start_connection() + make_wrapper(pnc).open(*rc->connection_options_); + } start_connection(cc.connected_address_, pnc); rc->retries_++; } --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
