Bug in TWebTableControl

After upgrading to 2.1, I have noticed a bug in TCustomTableControl.
When destroying a form containing a Table, it crashes. After debugging I found out that in
destructor TCustomTableControl.Destroy;

the Header object is freed BEFORE the inherited clause.
The latter starts an invalidate proc that checks the status of the already dead Header.

Solution: move the Inherited clause at the beginning of the destructor.

destructor TCustomTableControl.Destroy;
begin
inherited;
FOptions.Free;
FHeader.Free;
FFooter.Free;
FPaging.Free;
// inherited; << it was here!
end;

This workaround solved my problem, but I trust TMS will want to investigate the issue further.

Thanks for reporting.
We fixed this at TControl level though, avoiding the Invalidate when the component is in destroying state. The next update will address this.

Thanks to you, Bruno. Other than this small glitch, the upscaled TWebTableControl is amazing.

1 Like