Using Delphi Berlin with update 1.
Pack version is 3.5.0.1
LEDBar version is 1.5.0.1
I have a form with two (2) TTMSFMXLEDBar on it.
The form has been working correctly on a FMX Windows Client for many months.
Running it for the first time on Android I get a Segmentation fault (11) error
when the form is exited.
Stepping through the unit FMX.TMXLed I see ::-
Debugger goes to :-
destructor TTMSFMXLEDBar.Destroy;
begin
FLeds.Free;
inherited;
end;
Then to :-
procedure TTMSFMXLEDBar.SetValue(const Value: Integer);
var
I: Integer;
begin
FValue := Max(0, Min(Leds.Count, Value));
for I := 0 to Leds.Count - 1 do
Leds.State := Value > I;
Repaint;
end;
Get the error on line FValue := ...
This is due to Leds being unassigned.
It is very easy to set up a test project with this error.
Step 1. Create a new project.
Step 2. Place the TTMSFMXLEDBar on the form.
Step 3. Run under Windows. Exit. This is OK.
Step 4. Run under Android. Exit. Get the Segmentation fault.
Regards,
Peter Evans
Hi,
We have tested this here but are not able to reproduce this issue. When placing a TTMSFMXLEDBar on the form, running it on Android works as expected. Can you provide a sample which is able to reproduce this issue?
I have just sent a sample project to support.
I have a workaround for this problem.
In the FormDestroy event code :-
{$IFDEF ANDROID}
ledbarA.Leds.Clear;
ledbarB.Leds.Clear;
{$ENDIF}