diff options
| author | Gordon Sim <gsim@apache.org> | 2010-06-01 18:54:56 +0000 |
|---|---|---|
| committer | Gordon Sim <gsim@apache.org> | 2010-06-01 18:54:56 +0000 |
| commit | a942c5e9625068a7a1585ad1e4cc8138830a8500 (patch) | |
| tree | 255d66d953bc90a6c83e47afd66ef37011625716 /cpp/src/qpid/sys/posix/AsynchIO.cpp | |
| parent | 00513930d81a9344683c54a620da02dcd35da400 (diff) | |
| download | qpid-python-a942c5e9625068a7a1585ad1e4cc8138830a8500.tar.gz | |
QPID-2636: Ensure close is called for a disconnect preventing occasional leaks of abruptly terminated connections
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@950201 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/sys/posix/AsynchIO.cpp')
| -rw-r--r-- | cpp/src/qpid/sys/posix/AsynchIO.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/cpp/src/qpid/sys/posix/AsynchIO.cpp b/cpp/src/qpid/sys/posix/AsynchIO.cpp index fd7886145b..cef9f1fcef 100644 --- a/cpp/src/qpid/sys/posix/AsynchIO.cpp +++ b/cpp/src/qpid/sys/posix/AsynchIO.cpp @@ -554,13 +554,9 @@ void AsynchIO::writeable(DispatchHandle& h) { } void AsynchIO::disconnected(DispatchHandle& h) { - // If we've already queued close do it instead of disconnected callback - if (queuedClose) { - close(h); - } else if (disCallback) { - disCallback(*this); - h.unwatch(); - } + // If we have not already queued close then call disconnected callback before closing + if (!queuedClose && disCallback) disCallback(*this); + close(h); } /* |
