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

@ -14,7 +14,7 @@ namespace gns {
* Represent a GNS3 server
* Wrapper around the GNS3 API (https://gns3-server.readthedocs.io/en/latest/endpoints.html)
*/
class GnsServer {
class GnsServer : std::enable_shared_from_this<GnsServer> {
public:
GnsServer(const std::string& host, std::uint16_t port);