math and data module instances are now deleted when they have no more Lua references (matches the behaviour of other modules.) Fixes the deprecation system not fully restarting when love.event.quit("restart") is called.

Resolves issue #1462.
This commit is contained in:
Alex Szpakowski
2018-12-17 16:44:13 -04:00
parent d4762b4612
commit 5d5c2f9a96
6 changed files with 38 additions and 41 deletions
-5
View File
@@ -199,14 +199,9 @@ float linearToGamma(float c)
return 1.055f * powf(c, 1.0f / 2.4f) - 0.055f;
}
Math Math::instance;
Math::Math()
: rng()
{
// prevent the runtime from free()-ing this
retain();
RandomGenerator::Seed seed;
seed.b64 = (uint64) time(nullptr);
rng.setSeed(seed);