summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/StreamI.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/Ice/StreamI.cpp')
-rw-r--r--cpp/src/Ice/StreamI.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/cpp/src/Ice/StreamI.cpp b/cpp/src/Ice/StreamI.cpp
index 26ecc8acb19..9a6d4cfca04 100644
--- a/cpp/src/Ice/StreamI.cpp
+++ b/cpp/src/Ice/StreamI.cpp
@@ -698,7 +698,14 @@ Ice::UserExceptionWriter::~UserExceptionWriter() throw()
void
Ice::UserExceptionWriter::__write(BasicStream* os) const
{
- OutputStreamPtr stream = new OutputStreamI(_communicator, os);
+ OutputStreamI* stream = reinterpret_cast<OutputStreamI*>(os->closure());
+ if(!stream)
+ {
+ //
+ // Required for IcePy usage
+ //
+ stream = new OutputStreamI(_communicator, os);
+ }
write(stream);
}