diff options
author | Michi Henning <michi@zeroc.com> | 2007-03-19 03:31:04 +0000 |
---|---|---|
committer | Michi Henning <michi@zeroc.com> | 2007-03-19 03:31:04 +0000 |
commit | 55538ff830b8f462a2a9cd8d9caf892f91803d8b (patch) | |
tree | 33b1244f198daf7da400156123629d85a198e577 /cppe/src/IceE/ExceptionBase.cpp | |
parent | Fixed bug 2005 (diff) | |
download | ice-55538ff830b8f462a2a9cd8d9caf892f91803d8b.tar.bz2 ice-55538ff830b8f462a2a9cd8d9caf892f91803d8b.tar.xz ice-55538ff830b8f462a2a9cd8d9caf892f91803d8b.zip |
Bug 2048.
Diffstat (limited to 'cppe/src/IceE/ExceptionBase.cpp')
-rwxr-xr-x | cppe/src/IceE/ExceptionBase.cpp | 16 |
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 { |