summaryrefslogtreecommitdiff
path: root/cppe/src/IceE/ExceptionBase.cpp
diff options
context:
space:
mode:
authorMichi Henning <michi@zeroc.com>2007-03-19 03:31:04 +0000
committerMichi Henning <michi@zeroc.com>2007-03-19 03:31:04 +0000
commit55538ff830b8f462a2a9cd8d9caf892f91803d8b (patch)
tree33b1244f198daf7da400156123629d85a198e577 /cppe/src/IceE/ExceptionBase.cpp
parentFixed bug 2005 (diff)
downloadice-55538ff830b8f462a2a9cd8d9caf892f91803d8b.tar.bz2
ice-55538ff830b8f462a2a9cd8d9caf892f91803d8b.tar.xz
ice-55538ff830b8f462a2a9cd8d9caf892f91803d8b.zip
Bug 2048.
Diffstat (limited to 'cppe/src/IceE/ExceptionBase.cpp')
-rwxr-xr-xcppe/src/IceE/ExceptionBase.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/cppe/src/IceE/ExceptionBase.cpp b/cppe/src/IceE/ExceptionBase.cpp
index dd8e5979609..22c4ea4f4cc 100755
--- a/cppe/src/IceE/ExceptionBase.cpp
+++ b/cppe/src/IceE/ExceptionBase.cpp
@@ -9,6 +9,7 @@
#include <IceE/Exception.h>
#include <IceE/SafeStdio.h>
+#include <IceE/StaticMutex.h>
using namespace std;
@@ -49,12 +50,25 @@ IceUtil::Exception::toString() const
string out;
if(_file && _line > 0)
{
- out += Ice::printfToString("%s:%d: ", _file, _line);
+ out += Ice::printfToString("%s:%d: ", _file, _line);
}
out += ice_name();
return out;
}
+const char*
+IceUtil::Exception::what() const throw()
+{
+ StaticMutex::Lock lock(globalMutex);
+ {
+ if(_str.empty())
+ {
+ _str = toString(); // Lazy initialization.
+ }
+ }
+ return _str.c_str();
+}
+
IceUtil::Exception*
IceUtil::Exception::ice_clone() const
{