From f53f6dffa62dd731b7104c6d56fe8f859b7fa50c Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 6 Jan 2011 16:34:16 -0500 Subject: [svn-r19923] BZ 1165: Implemented declaration change; A static std::basic_string constructed in the Exception class. This static isn't one that can be be destructed by H5Library::close(), but rather gets cleaned up as part of the STL std::basic_string static destructor when the HDF5 DLL is detached (WINDOWS). Looking at the rest of the Exception code, the DEFAULT_MSG doesn't really need to be a std::basic_string. Remove the static constructor and no destructor required. Tested: local linux - will wait for Nightly Dailies before bringing to 1.8 --- c++/src/H5Exception.cpp | 6 +++--- c++/src/H5Exception.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/c++/src/H5Exception.cpp b/c++/src/H5Exception.cpp index 556bf21..8513372 100644 --- a/c++/src/H5Exception.cpp +++ b/c++/src/H5Exception.cpp @@ -22,7 +22,7 @@ namespace H5 { #endif -const H5std_string Exception::DEFAULT_MSG("No detailed information provided"); +const char Exception::DEFAULT_MSG[] = "No detailed information provided"; //-------------------------------------------------------------------------- // Function: Exception default constructor @@ -252,7 +252,7 @@ void Exception::walkErrorStack( H5E_direction_t direction, H5E_walk2_t func, voi // Function: Exception::getDetailMsg ///\brief Returns the detailed message set at the time the exception /// is thrown. -///\return Text message - \c std::string +///\return Text message - \c H5std_string // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5std_string Exception::getDetailMsg() const @@ -275,7 +275,7 @@ const char* Exception::getCDetailMsg() const //-------------------------------------------------------------------------- // Function: Exception::getFuncName ///\brief Returns the name of the function, where the exception is thrown. -///\return Text message - \c std::string +///\return Text message - \c H5std_string // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5std_string Exception::getFuncName() const diff --git a/c++/src/H5Exception.h b/c++/src/H5Exception.h index c17ff5b..b4af2ba 100644 --- a/c++/src/H5Exception.h +++ b/c++/src/H5Exception.h @@ -84,7 +84,7 @@ class H5_DLLCPP Exception { protected: // Default value for detail_message - static const H5std_string DEFAULT_MSG; + static const char DEFAULT_MSG[]; }; class H5_DLLCPP FileIException : public Exception { -- cgit v0.12