From 77d19859bc20dc11f1b75cd5a38c79238ee54bae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20D=C3=BCrrenberger?= Date: Thu, 13 Oct 2016 23:41:15 +0200 Subject: [PATCH] Added protected d-tor to sf::NonCopyable to prevent possible resource leaks. --- include/SFML/System/NonCopyable.hpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/SFML/System/NonCopyable.hpp b/include/SFML/System/NonCopyable.hpp index 40943765b..148405a16 100644 --- a/include/SFML/System/NonCopyable.hpp +++ b/include/SFML/System/NonCopyable.hpp @@ -51,6 +51,16 @@ protected: /// //////////////////////////////////////////////////////////// NonCopyable() {} + + //////////////////////////////////////////////////////////// + /// \brief Default destructor + /// + /// By declaring a protected destructor it's impossible to + /// call delete on a pointer of sf::NonCopyable, thus + /// preventing possible resource leaks. + /// + //////////////////////////////////////////////////////////// + ~NonCopyable() {} private: