1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-11 23:54:18 +00:00

Protected the system Random from having its seed reset

This commit is contained in:
Tom Poole 2018-11-30 15:49:03 +00:00
parent e5d1e0008e
commit 415dc54820

View file

@ -38,6 +38,16 @@ Random::~Random() noexcept
void Random::setSeed (const int64 newSeed) noexcept
{
if (this == &getSystemRandom())
{
// Resetting the system Random risks messing up
// JUCE's internal state. If you need a predictable
// stream of random numbers you should use a local
// Random object.
jassertfalse;
return;
}
seed = newSeed;
}