You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ac...@apache.org on 2017/10/19 12:39:55 UTC

[09/50] qpid-proton git commit: PROTON-1556: work around for C++ binding ssl_domain self assignment bug

PROTON-1556: work around for C++ binding ssl_domain self assignment bug


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/1bb1897f
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/1bb1897f
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/1bb1897f

Branch: refs/heads/go1
Commit: 1bb1897fecbf50f818adc5fe26667a121bad220a
Parents: 937e505
Author: Clifford Jansen <cl...@apache.org>
Authored: Wed Oct 11 17:53:36 2017 -0700
Committer: Clifford Jansen <cl...@apache.org>
Committed: Wed Oct 11 17:53:36 2017 -0700

----------------------------------------------------------------------
 proton-c/bindings/cpp/src/ssl_domain.cpp | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/1bb1897f/proton-c/bindings/cpp/src/ssl_domain.cpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/src/ssl_domain.cpp b/proton-c/bindings/cpp/src/ssl_domain.cpp
index bb95bec..143ff5a 100644
--- a/proton-c/bindings/cpp/src/ssl_domain.cpp
+++ b/proton-c/bindings/cpp/src/ssl_domain.cpp
@@ -28,6 +28,7 @@ namespace proton {
 
 /// TODO: This whole class isn't really needed as pn_ssl_domain_t is already refcounted, with shared ownership for all pn_ssl_t objects
 /// that hold one
+/// cjansen: but note it is not a PN_CLASS object and two pn_ssl_domain_free() from the app will cause a free while still in use.
 class ssl_domain_impl {
   public:
     ssl_domain_impl(bool is_server) : refcount_(1), pn_domain_(pn_ssl_domain(is_server ? PN_SSL_MODE_SERVER : PN_SSL_MODE_CLIENT)) {
@@ -56,6 +57,7 @@ ssl_domain::ssl_domain(const ssl_domain &x) : impl_(x.impl_), server_type_(x.ser
 }
 
 ssl_domain& internal::ssl_domain::operator=(const ssl_domain&x) {
+    if (&x == this) return *this;
     if (impl_) impl_->decref();
     impl_ = x.impl_;
     server_type_ = x.server_type_;


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org