updated minor memory management to avoid text corruption
This commit is contained in:
parent
4e547635d8
commit
9c413c0edd
6 changed files with 17 additions and 15 deletions
|
@ -9,14 +9,14 @@
|
|||
namespace gns {
|
||||
|
||||
|
||||
GnsNode::GnsNode(const GnsProject *project, std::string uuid, const std::vector<GnsPort>& ports) {
|
||||
GnsNode::GnsNode(const GnsProject *project, const std::string& uuid, const std::vector<GnsPort>& ports) {
|
||||
this->project = project;
|
||||
this->uuid = std::move(uuid);
|
||||
this->uuid = uuid;
|
||||
this->ports = ports;
|
||||
}
|
||||
|
||||
std::string GnsNode::getApiBase() const {
|
||||
return this->project->getApiBase() + "nodes/" + this->uuid + "/";
|
||||
return this->project->getApiBase() + "nodes/" + this->getUuid() + "/";
|
||||
}
|
||||
|
||||
std::string GnsNode::getUuid() const {
|
||||
|
@ -30,7 +30,7 @@ std::vector<GnsPort> GnsNode::getPorts() const {
|
|||
void GnsNode::start() const {
|
||||
// request the API endpoint
|
||||
cpr::Url endpoint = this->getApiBase() + "start";
|
||||
cpr::Response response = Post(endpoint);
|
||||
const cpr::Response response = Post(endpoint);
|
||||
|
||||
// check for a valid response
|
||||
if (response.error.code != cpr::ErrorCode::OK)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue