X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FEvents%2FEvents_Error.cpp;h=4b7670e8ef55e1c54794c6880b01b4191151c7ed;hb=506a83727ca8f8297fc1dcdf4ea40d7865c35450;hp=eba313e5f1a9a42ad1b090e8c52d9a45e90e2c74;hpb=0ff644739fa90d6f15d410f69e41bb5d1cddc25a;p=modules%2Fshaper.git diff --git a/src/Events/Events_Error.cpp b/src/Events/Events_Error.cpp index eba313e5f..4b7670e8e 100644 --- a/src/Events/Events_Error.cpp +++ b/src/Events/Events_Error.cpp @@ -1,3 +1,5 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D + /* * Events_Error.cpp * @@ -8,8 +10,8 @@ #include #include -Events_Error::Events_Error(char* theDescription, const void* theSender) - : Events_Message(Events_Error::errorID(), theSender) +Events_Error::Events_Error(const std::string& theDescription, const void* theSender) + : Events_Message(Events_Error::errorID(), theSender) { myDescription = theDescription; } @@ -24,18 +26,14 @@ Events_ID Events_Error::errorID() return aLoop->eventByName("ApplicationError"); } -char* Events_Error::description() const -{ - return myDescription; -} - -void Events_Error::send(char* theDescription, const void* theSender) +const char* Events_Error::description() const { - Events_Error anError(theDescription, theSender); - Events_Loop::loop()->send(anError); + return myDescription.c_str(); } -static void send(std::string theDescription, const void* theSender = 0) +void Events_Error::send(const std::string& theDescription, const void* theSender) { - Events_Error::send(theDescription.c_str(), theSender); + std::shared_ptr aNewOne = + std::shared_ptr(new Events_Error(theDescription, theSender)); + Events_Loop::loop()->send(aNewOne); }