Web forum is in read-only mode. Login as active registered customer for write access
  Forum Search   New Posts New Posts

Access Violation in AdvShapeButton

 Post Reply Post Reply
Author
Terebizh Alexander View Drop Down
New Member
New Member
Avatar

Joined: 01 Jan 2015
Posts: 7
Post Options Post Options   Quote Terebizh Alexander Quote  Post ReplyReply Direct Link To This Post Topic: Access Violation in AdvShapeButton
    Posted: 20 May 2019 at 5:09pm
advshapebutton.pas ver 6.2.1.5 size 147 909

procedure TAdvCustomShapeButton.SwitchMetro(Value: Boolean)
.
line 2079, creating FMetroAppearance object:
    if not Assigned(FMetroAppearance) then
      FMetroAppearance := TAdvShapeButtonAppearance.Create(Self);

next line 2085:
    FMetroAppearance.Color := TBFormMetroTones.Background.BrushColor;

invoking TAdvShapeButtonAppearance.SetColor(const Value: TColor)

line 4315 calling UpdateButtonColor(FColor);

line 4566:
    if Assigned(FOwner.FMetroAppearance) then
    begin
      FOwner.FMetroAppearance.Free;
      FOwner.FMetroAppearance := nil;
    end;

Bingo! We freed and nil FMetroAppearance object, created at line 2079

next we return to SetColor and return to SwitchMetro to line 2086 and see

    FMetroAppearance.ColorTo := clNone;

but FMetroAppearance is freed and nil at line 4655 and AV fired

With best regards, Alexander
Back to Top
Terebizh Alexander View Drop Down
New Member
New Member
Avatar

Joined: 01 Jan 2015
Posts: 7
Post Options Post Options   Quote Terebizh Alexander Quote  Post ReplyReply Direct Link To This Post Posted: 20 May 2019 at 5:20pm
steps to reproduce:

application has AdvShapeButton

1. App started in RDP session (host is windows 10 or Server 2016 terminal)
2. close RDP session, app till working
3. reconnect to this RDP session
4. AV fired (App receive "stylechange" message and calling SwithMetro)
Back to Top
Bruno Fierens View Drop Down
TMS Support
TMS Support
Avatar

Joined: 11 May 2010
Posts: 7700
Post Options Post Options   Quote Bruno Fierens Quote  Post ReplyReply Direct Link To This Post Posted: 20 May 2019 at 9:40pm
Thanks for reporting. We have traced & solved this issue and can confirm the next update will address this.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down