From c95e40580ef57d5a1e36e9105ae18dbffe3c3de8 Mon Sep 17 00:00:00 2001 From: "Charles E. Rolke" Date: Mon, 10 Jan 2011 20:43:56 +0000 Subject: .NET Binding for Qpid Messaging, in every .NET object that keeps a reference to unmanaged memory: * Function Cleanup() is deleted and cleanup is moved to Finalizer. * Destructor calls Finalizer. * Finalizer takes a lock before deleting unmanaged memory. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1057350 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/bindings/qpid/dotnet/src/FailoverUpdates.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'cpp/bindings/qpid/dotnet/src/FailoverUpdates.cpp') diff --git a/cpp/bindings/qpid/dotnet/src/FailoverUpdates.cpp b/cpp/bindings/qpid/dotnet/src/FailoverUpdates.cpp index a931e2d670..d34474f2c4 100644 --- a/cpp/bindings/qpid/dotnet/src/FailoverUpdates.cpp +++ b/cpp/bindings/qpid/dotnet/src/FailoverUpdates.cpp @@ -64,21 +64,15 @@ namespace Messaging { // Destructor FailoverUpdates::~FailoverUpdates() { - Cleanup(); + this->!FailoverUpdates(); } // Finalizer FailoverUpdates::!FailoverUpdates() { - Cleanup(); - } - + msclr::lock lk(this); - // Destroys kept object - // TODO: add lock - void FailoverUpdates::Cleanup() - { if (NULL != failoverupdatesp) { delete failoverupdatesp; -- cgit v1.2.1