Skip to content

Commit 77d1985

Browse files
committed
Added protected d-tor to sf::NonCopyable to prevent possible resource leaks.
1 parent 67ef694 commit 77d1985

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

include/SFML/System/NonCopyable.hpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,16 @@ class SFML_SYSTEM_API NonCopyable
5151
///
5252
////////////////////////////////////////////////////////////
5353
NonCopyable() {}
54+
55+
////////////////////////////////////////////////////////////
56+
/// \brief Default destructor
57+
///
58+
/// By declaring a protected destructor it's impossible to
59+
/// call delete on a pointer of sf::NonCopyable, thus
60+
/// preventing possible resource leaks.
61+
///
62+
////////////////////////////////////////////////////////////
63+
~NonCopyable() {}
5464

5565
private:
5666

0 commit comments

Comments
 (0)