mirror of
https://github.com/love2d/love.git
synced 2026-08-12 16:40:57 +02:00
Added Object:release. Calling it is the equivalent of removing all Lua-side references to an object and doing a full garbage collection cycle (thus deleting the object from memory if nothing else in LÖVE's code is referencing it).
Any attempt to call a method on the object after it has been released will result in an error. Object:release() returns true if it was successful, or false if not (if it has already been released previously). --HG-- branch : minor
This commit is contained in:
@@ -126,7 +126,7 @@ static FFI_RandomGenerator ffifuncs =
|
||||
[](Proxy *p) -> double // random()
|
||||
{
|
||||
// FIXME: We need better type-checking...
|
||||
if (p == nullptr || !typeFlags[p->type][MATH_RANDOM_GENERATOR_ID])
|
||||
if (p == nullptr || p->object == nullptr || !typeFlags[p->type][MATH_RANDOM_GENERATOR_ID])
|
||||
return 0.0;
|
||||
|
||||
RandomGenerator *rng = (RandomGenerator *) p->object;
|
||||
|
||||
Reference in New Issue
Block a user