Lifepower
-
2017-12-10
- Milestone: 1.0 --> 1.1
In PXL.Surfaces.pas, the following code:
function TCustomLockableTexture.Lock(const Rect: TIntRect; out Surface: TPixelSurface): Boolean;
var
LockedPixels: TLockedPixels;
begin
if not Lock(Rect, LockedPixels) then
begin
Surface := nil;
Exit(False);
end;
FLockSurface := TLockedPixelsSurfaceWrapper.Create(Self, LockedPixels);
Surface := FLockSurface;
Result := True;
end;
Note that "FLockSurface" is a weak reference under Delphi/ARC, so it gets instantly released and as result, NIL is returned. This bug was found when rendering to bitmaps on Android by Ben Maas, who also kindly helped to debug the bug and find where it occurs.