From 8ca2a8a726965b82bf1619db888323d18b8c03c8 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@791997 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/cpp/src/qpid/sys/windows/AsynchIO.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'qpid/cpp/src') diff --git a/qpid/cpp/src/qpid/sys/windows/AsynchIO.cpp b/qpid/cpp/src/qpid/sys/windows/AsynchIO.cpp index 88be5d7634..8de2eccc84 100644 --- a/qpid/cpp/src/qpid/sys/windows/AsynchIO.cpp +++ b/qpid/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