Jump to content
pete42

Stack overflow / TStyleBook.GetStyle?

Recommended Posts

Can anyone tell me if this causes a stack overflow?

 

unit FMX.Controls;

function TStyleBook.GetStyle(const Context: TFmxObject): TFmxObject;
var
  Idx: Integer;
begin
  Idx := StyleIndexByContext(Context);
  if Idx >= 0 then
    Result := Styles[Idx].Style
  else
    Result := Style; <<< This Property call results in an infinite GetStyle call?!
end;

 

Thanks!

Share this post


Link to post
51 minutes ago, pete42 said:

This Property call results in an infinite GetStyle call?!

FMX.Controls.pas, line 1180 (RAD11.3)  ->  property Style: TFmxObject read GetStyle;   then, yes! a infinity looping if "(Idx<0)"   🙂 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×