use smart pointer when creating an object with an instance of the creator
This commit is contained in:
parent
a0060c8fa8
commit
f1ee437f04
6 changed files with 12 additions and 10 deletions
|
@ -10,7 +10,7 @@ using json = nlohmann::json;
|
|||
namespace gns {
|
||||
|
||||
|
||||
GnsProject::GnsProject(const GnsServer* server, const std::string& uuid) {
|
||||
GnsProject::GnsProject(const std::shared_ptr<const GnsServer>& server, const std::string& uuid) {
|
||||
this->server = server;
|
||||
this->uuid = uuid;
|
||||
}
|
||||
|
@ -60,7 +60,7 @@ std::vector<std::shared_ptr<GnsNode>> GnsProject::getNodes() const {
|
|||
|
||||
// save the node
|
||||
nodes.emplace_back(std::make_shared<GnsNode>(
|
||||
this,
|
||||
shared_from_this(),
|
||||
node_data["node_id"],
|
||||
ports
|
||||
));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue