diff --git a/include/SFML/System/Sleep.hpp b/include/SFML/System/Sleep.hpp index 8cc23f526..f131d934e 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 1c2205411..a984db01e 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