use smart pointer when creating an object with an instance of the creator

This commit is contained in:
faraphel 2024-12-23 13:12:46 +01:00
parent a0060c8fa8
commit f1ee437f04
6 changed files with 12 additions and 10 deletions

View file

@ -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
));