From 5269fc0e04984b2d196d5eaf96e206e034d21184 Mon Sep 17 00:00:00 2001 From: Ted Ross Date: Fri, 20 Aug 2010 13:58:20 +0000 Subject: QPID-2798 - C++ Messaging Client .NET binding fails to clone managed objects correctly Patch from Chuck Rolke git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@987510 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/bindings/qpid/dotnet/src/Session.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'cpp/bindings/qpid/dotnet/src/Session.h') diff --git a/cpp/bindings/qpid/dotnet/src/Session.h b/cpp/bindings/qpid/dotnet/src/Session.h index 18dc09fb33..d34289b1bb 100644 --- a/cpp/bindings/qpid/dotnet/src/Session.h +++ b/cpp/bindings/qpid/dotnet/src/Session.h @@ -65,7 +65,9 @@ namespace Messaging { void Cleanup(); public: - Session(::qpid::messaging::Session * sessionp, + + // unmanaged clone + Session(const ::qpid::messaging::Session & sessionp, Connection ^ connRef); // copy constructor @@ -83,9 +85,11 @@ namespace Messaging { } else { - delete sessionp; + if (NULL != sessionp) + delete sessionp; sessionp = new ::qpid::messaging::Session( *(const_cast(rhs).NativeSession) ); + parentConnectionp = rhs.parentConnectionp; } return *this; } @@ -129,7 +133,6 @@ namespace Messaging { Receiver ^ CreateReceiver(System::String ^ address); Receiver ^ CreateReceiver(Address ^ address); - Receiver ^ CreateReceiver(); Sender ^ GetSender(System::String ^ name); Receiver ^ GetReceiver(System::String ^ name); -- cgit v1.2.1