diff options
author | Benoit Foucher <benoit@zeroc.com> | 2016-02-03 20:31:13 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2016-02-03 20:31:13 +0100 |
commit | f4bc38dd7a9dafa122002dbf54d277de2640e6dd (patch) | |
tree | 8ef99d69efe24037715a8c4a5d44b23d5a866907 /cpp/src/Ice/CollocatedRequestHandler.cpp | |
parent | Fixed Windows build issue (diff) | |
download | ice-f4bc38dd7a9dafa122002dbf54d277de2640e6dd.tar.bz2 ice-f4bc38dd7a9dafa122002dbf54d277de2640e6dd.tar.xz ice-f4bc38dd7a9dafa122002dbf54d277de2640e6dd.zip |
Fixed exception test failure with C++11 mapping
Diffstat (limited to 'cpp/src/Ice/CollocatedRequestHandler.cpp')
-rw-r--r-- | cpp/src/Ice/CollocatedRequestHandler.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/cpp/src/Ice/CollocatedRequestHandler.cpp b/cpp/src/Ice/CollocatedRequestHandler.cpp index f6ab4092aa5..4fbf0d0bc7b 100644 --- a/cpp/src/Ice/CollocatedRequestHandler.cpp +++ b/cpp/src/Ice/CollocatedRequestHandler.cpp @@ -306,6 +306,13 @@ CollocatedRequestHandler::invokeAsyncRequest(OutgoingAsyncBase* outAsync, int ba } else // Optimization: directly call invokeAll if there's no dispatcher. { + // + // Make sure to hold a reference on this handler while the call is being + // dispatched. Otherwise, the handler could be deleted during the dispatch + // if a retry occurs. + // + CollocatedRequestHandlerPtr self(shared_from_this()); + if(sentAsync(outAsync)) { invokeAll(outAsync->getOs(), requestId, batchRequestNum); |