mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-10-17 05:09:20 +02:00
fix(sonar): give polymorphic base classes virtual destructors (cpp:S1235)
This commit is contained in:
@@ -41,6 +41,7 @@ class TFricMat
|
|||||||
public:
|
public:
|
||||||
virtual double GetFC(double N, double Vel);
|
virtual double GetFC(double N, double Vel);
|
||||||
|
|
||||||
|
virtual ~TFricMat() = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -272,6 +272,7 @@ class TReservoir
|
|||||||
|
|
||||||
/// <summary>Default constructor — creates a 1 L reservoir at zero pressure.</summary>
|
/// <summary>Default constructor — creates a 1 L reservoir at zero pressure.</summary>
|
||||||
TReservoir() = default;
|
TReservoir() = default;
|
||||||
|
virtual ~TReservoir() = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
/// <summary>Pointer typedef for a reservoir instance.</summary>
|
/// <summary>Pointer typedef for a reservoir instance.</summary>
|
||||||
@@ -504,6 +505,7 @@ class TBrake
|
|||||||
{
|
{
|
||||||
UniversalFlag = flag;
|
UniversalFlag = flag;
|
||||||
} // przycisk uniwersalny
|
} // przycisk uniwersalny
|
||||||
|
virtual ~TBrake() = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -1086,6 +1088,7 @@ class TDriverHandle
|
|||||||
{
|
{
|
||||||
memset(Sounds, 0, sizeof(Sounds));
|
memset(Sounds, 0, sizeof(Sounds));
|
||||||
}
|
}
|
||||||
|
virtual ~TDriverHandle() = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -57,4 +57,5 @@ struct IMaterial
|
|||||||
} null_material{};
|
} null_material{};
|
||||||
return &null_material;
|
return &null_material;
|
||||||
}
|
}
|
||||||
|
virtual ~IMaterial() = default;
|
||||||
};
|
};
|
||||||
@@ -73,4 +73,5 @@ struct ITexture
|
|||||||
} null_texture{};
|
} null_texture{};
|
||||||
return &null_texture;
|
return &null_texture;
|
||||||
}
|
}
|
||||||
|
virtual ~ITexture() = default;
|
||||||
};
|
};
|
||||||
@@ -21,6 +21,7 @@ struct message
|
|||||||
message(type_e t) : type(t) {}
|
message(type_e t) : type(t) {}
|
||||||
virtual void serialize(std::ostream &stream) const {}
|
virtual void serialize(std::ostream &stream) const {}
|
||||||
virtual void deserialize(std::istream &stream) {}
|
virtual void deserialize(std::istream &stream) {}
|
||||||
|
virtual ~message() = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct client_hello : public message
|
struct client_hello : public message
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ namespace network
|
|||||||
DEAD
|
DEAD
|
||||||
};
|
};
|
||||||
peer_state state;
|
peer_state state;
|
||||||
|
virtual ~connection() = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
class server
|
class server
|
||||||
@@ -104,6 +105,7 @@ namespace network
|
|||||||
int get_awaiting_frames() const {
|
int get_awaiting_frames() const {
|
||||||
return static_cast<int>(delta_queue.size());
|
return static_cast<int>(delta_queue.size());
|
||||||
}
|
}
|
||||||
|
virtual ~client() = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
class backend_manager
|
class backend_manager
|
||||||
@@ -112,6 +114,7 @@ namespace network
|
|||||||
virtual std::shared_ptr<server> create_server(std::shared_ptr<std::fstream>, const std::string &conf) = 0;
|
virtual std::shared_ptr<server> create_server(std::shared_ptr<std::fstream>, const std::string &conf) = 0;
|
||||||
virtual std::shared_ptr<client> create_client(const std::string &conf) = 0;
|
virtual std::shared_ptr<client> create_client(const std::string &conf) = 0;
|
||||||
virtual void update() = 0;
|
virtual void update() = 0;
|
||||||
|
virtual ~backend_manager() = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
// HACK: static initialization order fiasco fix
|
// HACK: static initialization order fiasco fix
|
||||||
|
|||||||
Reference in New Issue
Block a user