Skip to content

Commit

Permalink
- you need to strdup the message otherwise you get bad messages conta…
Browse files Browse the repository at this point in the history
  • Loading branch information
adrpo committed Feb 21, 2015
1 parent 544c14b commit c843f04
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -23,15 +23,15 @@ class ModelicaSimulationError: public std::runtime_error
{
public:
ModelicaSimulationError(SIMULATION_ERROR error_id,const std::string& error_info)
:runtime_error(error_info)
:runtime_error(strdup(error_info.c_str()))
,_error_id(error_id)
{
}
const char* what()
{
std::stringstream ss;
ss << "simulation error message : " << std::runtime_error::what();
return ss.str().c_str();
return strdup(ss.str().c_str());
}
SIMULATION_ERROR getErrorID()
{
Expand Down

0 comments on commit c843f04

Please sign in to comment.