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 2018/11/02 20:46:27 UTC

[07/50] qpid-proton git commit: PROTON-1798: [cpp] add library destructors for main classes

PROTON-1798: [cpp] add library destructors for main classes

Add library destructors to anchor vtables and typeinfo for connection, session,
sender, recever and delivery.

Without them, the ubsan sanitizer reports mismatched types due to different
weak vtable symbols in scope at library and executable link time.


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

Branch: refs/heads/go1
Commit: 7885bd3b558dcf801e92ea866090d1110cc36aa1
Parents: e5aac00
Author: Alan Conway <ac...@redhat.com>
Authored: Wed Sep 5 14:12:20 2018 -0400
Committer: Alan Conway <ac...@redhat.com>
Committed: Fri Sep 7 11:26:25 2018 -0400

----------------------------------------------------------------------
 cpp/include/proton/connection.hpp | 2 ++
 cpp/include/proton/delivery.hpp   | 2 ++
 cpp/include/proton/receiver.hpp   | 2 ++
 cpp/include/proton/sender.hpp     | 2 ++
 cpp/include/proton/session.hpp    | 2 ++
 cpp/src/connection.cpp            | 2 ++
 cpp/src/delivery.cpp              | 1 +
 cpp/src/receiver.cpp              | 2 ++
 cpp/src/sender.cpp                | 2 ++
 cpp/src/session.cpp               | 2 ++
 10 files changed, 19 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/7885bd3b/cpp/include/proton/connection.hpp
----------------------------------------------------------------------
diff --git a/cpp/include/proton/connection.hpp b/cpp/include/proton/connection.hpp
index 77bf96d..de9c904 100644
--- a/cpp/include/proton/connection.hpp
+++ b/cpp/include/proton/connection.hpp
@@ -51,6 +51,8 @@ PN_CPP_CLASS_EXTERN connection : public internal::object<pn_connection_t>, publi
     /// Create an empty connection.
     connection() : internal::object<pn_connection_t>(0) {}
 
+    PN_CPP_EXTERN ~connection();
+
     PN_CPP_EXTERN bool uninitialized() const;
     PN_CPP_EXTERN bool active() const;
     PN_CPP_EXTERN bool closed() const;

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/7885bd3b/cpp/include/proton/delivery.hpp
----------------------------------------------------------------------
diff --git a/cpp/include/proton/delivery.hpp b/cpp/include/proton/delivery.hpp
index 61a2fbe..c1823d9 100644
--- a/cpp/include/proton/delivery.hpp
+++ b/cpp/include/proton/delivery.hpp
@@ -44,6 +44,8 @@ class delivery : public transfer {
   public:
     delivery() {}
 
+    PN_CPP_EXTERN ~delivery();
+
     /// Return the receiver for this delivery.
     PN_CPP_EXTERN class receiver receiver() const;
 

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/7885bd3b/cpp/include/proton/receiver.hpp
----------------------------------------------------------------------
diff --git a/cpp/include/proton/receiver.hpp b/cpp/include/proton/receiver.hpp
index 6c8137d..7f78401 100644
--- a/cpp/include/proton/receiver.hpp
+++ b/cpp/include/proton/receiver.hpp
@@ -47,6 +47,8 @@ PN_CPP_CLASS_EXTERN receiver : public link {
     /// Create an empty receiver.
     receiver() {}
 
+    PN_CPP_EXTERN ~receiver();
+
     /// Open the receiver.
     ///
     /// @see endpoint_lifecycle

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/7885bd3b/cpp/include/proton/sender.hpp
----------------------------------------------------------------------
diff --git a/cpp/include/proton/sender.hpp b/cpp/include/proton/sender.hpp
index 840032c..5f7c7b5 100644
--- a/cpp/include/proton/sender.hpp
+++ b/cpp/include/proton/sender.hpp
@@ -46,6 +46,8 @@ PN_CPP_CLASS_EXTERN sender : public link {
     /// Create an empty sender.
     sender() {}
 
+    PN_CPP_EXTERN ~sender();
+
     /// Open the sender.
     ///
     /// @see endpoint_lifecycle

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/7885bd3b/cpp/include/proton/session.hpp
----------------------------------------------------------------------
diff --git a/cpp/include/proton/session.hpp b/cpp/include/proton/session.hpp
index 78a1fd4..7f289f5 100644
--- a/cpp/include/proton/session.hpp
+++ b/cpp/include/proton/session.hpp
@@ -49,6 +49,8 @@ PN_CPP_CLASS_EXTERN session : public internal::object<pn_session_t>, public endp
     /// Create an empty session.
     session() : internal::object<pn_session_t>(0) {}
 
+    PN_CPP_EXTERN ~session();
+
     PN_CPP_EXTERN bool uninitialized() const;
     PN_CPP_EXTERN bool active() const;
     PN_CPP_EXTERN bool closed() const;

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/7885bd3b/cpp/src/connection.cpp
----------------------------------------------------------------------
diff --git a/cpp/src/connection.cpp b/cpp/src/connection.cpp
index b2dadae..223bb0c 100644
--- a/cpp/src/connection.cpp
+++ b/cpp/src/connection.cpp
@@ -45,6 +45,8 @@
 
 namespace proton {
 
+connection::~connection() {}
+
 transport connection::transport() const {
     return make_wrapper(pn_connection_transport(pn_object()));
 }

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/7885bd3b/cpp/src/delivery.cpp
----------------------------------------------------------------------
diff --git a/cpp/src/delivery.cpp b/cpp/src/delivery.cpp
index 0562304..7baa475 100644
--- a/cpp/src/delivery.cpp
+++ b/cpp/src/delivery.cpp
@@ -40,6 +40,7 @@ namespace proton {
 
 delivery::delivery(pn_delivery_t* d): transfer(make_wrapper(d)) {}
 receiver delivery::receiver() const { return make_wrapper<class receiver>(pn_delivery_link(pn_object())); }
+delivery::~delivery() {}
 void delivery::accept() { settle_delivery(pn_object(), ACCEPTED); }
 void delivery::reject() { settle_delivery(pn_object(), REJECTED); }
 void delivery::release() { settle_delivery(pn_object(), RELEASED); }

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/7885bd3b/cpp/src/receiver.cpp
----------------------------------------------------------------------
diff --git a/cpp/src/receiver.cpp b/cpp/src/receiver.cpp
index b7239a5..4d24c6f 100644
--- a/cpp/src/receiver.cpp
+++ b/cpp/src/receiver.cpp
@@ -39,6 +39,8 @@ namespace proton {
 
 receiver::receiver(pn_link_t* r): link(make_wrapper(r)) {}
 
+receiver::~receiver() {}
+
 void receiver::open() {
     attach();
 }

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/7885bd3b/cpp/src/sender.cpp
----------------------------------------------------------------------
diff --git a/cpp/src/sender.cpp b/cpp/src/sender.cpp
index 70e9fa6..003adf8 100644
--- a/cpp/src/sender.cpp
+++ b/cpp/src/sender.cpp
@@ -40,6 +40,8 @@ namespace proton {
 
 sender::sender(pn_link_t *l): link(make_wrapper(l)) {}
 
+sender::~sender() {}
+
 void sender::open() {
     attach();
 }

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/7885bd3b/cpp/src/session.cpp
----------------------------------------------------------------------
diff --git a/cpp/src/session.cpp b/cpp/src/session.cpp
index a64e0ad..fb2e6b3 100644
--- a/cpp/src/session.cpp
+++ b/cpp/src/session.cpp
@@ -36,6 +36,8 @@
 
 namespace proton {
 
+session::~session() {}
+
 void session::open() {
     pn_session_open(pn_object());
 }


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