diff options
| author | Stephen D. Huston <shuston@apache.org> | 2009-07-07 22:54:59 +0000 |
|---|---|---|
| committer | Stephen D. Huston <shuston@apache.org> | 2009-07-07 22:54:59 +0000 |
| commit | 8ca2a8a726965b82bf1619db888323d18b8c03c8 (patch) | |
| tree | 43e4176fa55abc5338730eb2285c688c57d9f871 | |
| parent | 9b6fe25998f66a4fef01f19fbb1a75529d63725b (diff) | |
| download | qpid-python-8ca2a8a726965b82bf1619db888323d18b8c03c8.tar.gz | |
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
| -rw-r--r-- | qpid/cpp/src/qpid/sys/windows/AsynchIO.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
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; } } |
