mirror of
https://github.com/nasa/trick.git
synced 2025-01-29 15:43:57 +00:00
exec_get_current_version returns string out of scope
Changed Trick::Executive::get_current_version to return a const reference to the string that holds the version. This avoids a copy of the string object and avoids that object going out of scope. As a string, the debug_command had the same problem so I fixed that one as well. refs #252
This commit is contained in:
parent
75fb095960
commit
d9f1780939
@ -297,7 +297,7 @@ namespace Trick {
|
||||
@code <my_char*> = trick.exec_get_current_version() @endcode
|
||||
@return string (C const char*) Executive::current_version
|
||||
*/
|
||||
std::string get_current_version() ;
|
||||
const std::string & get_current_version() ;
|
||||
|
||||
/**
|
||||
@userdesc Command to get the debugger command value.
|
||||
@ -305,7 +305,7 @@ namespace Trick {
|
||||
@code <my_char*> = trick.exec_get_debugger_command() @endcode
|
||||
@return string (C const char*) Executive::debugger_command
|
||||
*/
|
||||
std::string get_debugger_command() ;
|
||||
const std::string & get_debugger_command() ;
|
||||
|
||||
/**
|
||||
@userdesc Command to get the current Executive Mode command.
|
||||
|
@ -144,11 +144,11 @@ bool Trick::Executive::get_attach_debugger() {
|
||||
return(attach_debugger) ;
|
||||
}
|
||||
|
||||
std::string Trick::Executive::get_current_version() {
|
||||
const std::string & Trick::Executive::get_current_version() {
|
||||
return(current_version) ;
|
||||
}
|
||||
|
||||
std::string Trick::Executive::get_debugger_command() {
|
||||
const std::string & Trick::Executive::get_debugger_command() {
|
||||
return(debugger_command) ;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user