Skip to content

Commit d22daeb

Browse files
authored
Minor cleanup in AbstractIoHandler.sessionClosed() (#200)
Make sure QF_SESSION attribute gets removed in any case. SingleThreadedEventHandlingStrategy.onMessage might throw an Exception.
1 parent 5edc613 commit d22daeb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

quickfixj-core/src/main/java/quickfix/mina/AbstractIoHandler.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,12 @@ public void sessionClosed(IoSession ioSession) throws Exception {
110110
Session quickFixSession = findQFSession(ioSession);
111111
if (quickFixSession != null) {
112112
eventHandlingStrategy.onMessage(quickFixSession, EventHandlingStrategy.END_OF_STREAM);
113-
ioSession.removeAttribute(SessionConnector.QF_SESSION);
114113
}
115-
ioSession.closeNow();
116114
} catch (Exception e) {
117-
ioSession.closeNow();
118115
throw e;
116+
} finally {
117+
ioSession.removeAttribute(SessionConnector.QF_SESSION);
118+
ioSession.closeNow();
119119
}
120120
}
121121

0 commit comments

Comments
 (0)