From 97f1a0a45081edad67232860f6ae8e0797af0f37 Mon Sep 17 00:00:00 2001 From: "Stephen D. Huston" Date: Tue, 7 Jul 2009 22:54:59 +0000 Subject: Properly handle queued closes originating locally. Fixes QPID-1952 git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@791997 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/sys/windows/AsynchIO.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'cpp/src') diff --git a/cpp/src/qpid/sys/windows/AsynchIO.cpp b/cpp/src/qpid/sys/windows/AsynchIO.cpp index 88be5d7634..8de2eccc84 100644 --- a/cpp/src/qpid/sys/windows/AsynchIO.cpp +++ b/cpp/src/qpid/sys/windows/AsynchIO.cpp @@ -754,9 +754,14 @@ void AsynchIO::completion(AsynchIoResult *result) { working = false; } // Lock released; ok to close if ops are done and close requested. - // Layer above will call back to queueForDeletion() - if (opsInProgress == 0 && queuedClose) { - close(); + // Layer above will call back to queueForDeletion() if it hasn't + // already been done. If it already has, go ahead and delete. + if (opsInProgress == 0) { + if (queuedClose) + // close() may cause a delete; don't trust 'this' on return + close(); + else if (queuedDelete) + delete this; } } -- cgit v1.2.1