diff --git a/include/SFML/System/Sleep.hpp b/include/SFML/System/Sleep.hpp index 8cc23f52..f131d934 100644 --- a/include/SFML/System/Sleep.hpp +++ b/include/SFML/System/Sleep.hpp @@ -36,7 +36,7 @@ namespace sf //////////////////////////////////////////////////////////// /// Make the current thread sleep for a given time /// - /// \param Duration : Time to sleep, in seconds + /// \param Duration : Time to sleep, in seconds (must be >= 0) /// //////////////////////////////////////////////////////////// void SFML_API Sleep(float Duration); diff --git a/src/SFML/System/Sleep.cpp b/src/SFML/System/Sleep.cpp index 1c220541..a984db01 100644 --- a/src/SFML/System/Sleep.cpp +++ b/src/SFML/System/Sleep.cpp @@ -36,7 +36,8 @@ namespace sf //////////////////////////////////////////////////////////// void Sleep(float Duration) { - priv::Platform::Sleep(Duration); + if (Duration >= 0) + priv::Platform::Sleep(Duration); } } // namespace sf