Author: shuston Date: Tue Jul 7 22:54:59 2009 New Revision: 791997 URL: http://svn.apache.org/viewvc?rev=791997&view=rev Log: Properly handle queued closes originating locally. Fixes QPID-1952
Modified: qpid/trunk/qpid/cpp/src/qpid/sys/windows/AsynchIO.cpp Modified: qpid/trunk/qpid/cpp/src/qpid/sys/windows/AsynchIO.cpp URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/sys/windows/AsynchIO.cpp?rev=791997&r1=791996&r2=791997&view=diff ============================================================================== --- qpid/trunk/qpid/cpp/src/qpid/sys/windows/AsynchIO.cpp (original) +++ qpid/trunk/qpid/cpp/src/qpid/sys/windows/AsynchIO.cpp Tue Jul 7 22:54:59 2009 @@ -754,9 +754,14 @@ 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; } } --------------------------------------------------------------------- Apache Qpid - AMQP Messaging Implementation Project: http://qpid.apache.org Use/Interact: mailto:commits-subscr...@qpid.apache.org