Skip to content

IWBSButton DataTarget will create an access violation on destroy with FastMM enabled. #31

@littleearth

Description

@littleearth

FastMM will raise an exception when DataTarget is assigned on a IWBSButton and destruction of the form.
This is a work around I have found to ensure it is set to NIL

destructor TIWBSButton.Destroy;
var
  LDataTarget: Pointer;
begin
  try
    if Assigned(FDataTarget) then
    begin
      LDataTarget := @FDataTarget;
      if LDataTarget <> nil then
      begin
        try
          Pointer(FDataTarget) := nil;
        except
        end;
      end;
    end;
  finally
    inherited;
  end;
end;

To replicate enabled FastMM4 debug options on the IWBSDemo start demo and then exit.

To fix without using this above, edit Unit2 and add a FormDestroy event

IWBSButton49.DataTarget := nil;

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions