Return wxString for gfx importer messages

Returning a reference to a temporary value crashes when the value is
deallocated before use.  Passing a full string fixes the crash and
allows NVRO on the temporary value.
This commit is contained in:
Seth Hillbrand 2021-04-04 06:20:14 -07:00
parent fc8ffd8421
commit 4ec3f18fda
4 changed files with 4 additions and 4 deletions

View File

@ -217,7 +217,7 @@ public:
/**
* @return the list of messages in one string. Each message ends by '\n'
*/
const wxString& GetMessages() const override
wxString GetMessages() const override
{
return m_messages;
}

View File

@ -118,7 +118,7 @@ public:
*
* @return the list of messages in one string. Each message ends by '\n'
*/
const virtual wxString& GetMessages() const = 0;
virtual wxString GetMessages() const = 0;
protected:
///> Importer used to create objects representing the imported shapes.

View File

@ -83,7 +83,7 @@ public:
*
* @return the list of messages in one string. Each message ends by '\n'
*/
const wxString& GetMessages() const
wxString GetMessages() const
{
return m_plugin->GetMessages();
}

View File

@ -52,7 +52,7 @@ public:
/**
* @return the list of messages in one string. Each message ends by '\n'
*/
const wxString& GetMessages() const override
wxString GetMessages() const override
{
return m_messages;
}