Memory leak in v.11.23

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #56012
    Lasse
    Participant

      Oh, I see GetExternalSkinNames has changed and is now creating objects which I need to free. Ok, that fixed this.

      #56016
      Support
      Keymaster

        You are right, additional data has been added (ImageIndex).

        I will add a new parameter in the next release: “CreateDataObject: boolean = False”

        This data will not be added if CreateDataObject is False (default value).

        If you have a sources of the package you can replace this function in the sSkinManager.pas right now

        Code:
        function TsSkinManager.GetExternalSkinNames(sl: TacStrings; CreateDataObject: boolean = False; SkinType: TacSkinTypes = stAllSkins): acString;
        var
        stl: TacStringList;
        i: Integer;

        procedure AddItem(const sName: string; sImgIndex: integer);
        var
        iData: TacItemDrawData;
        begin
        if CreateDataObject then begin
        iData := TacItemDrawData.Create;
        iData.ImageIndex := sImgIndex;
        stl.AddObject(sName, iData);
        end
        else
        stl.Add(sName);
        end;

        begin
        Result := '';
        sl.Clear;
        if sl is TStringList then
        stl := TStringList(sl)
        else
        stl := TacStringList.Create;

        for i := 0 to Length(SkinListController.SkinList) – 1 do
        with SkinListController.SkinList do
        if skSkinMode <> smInternal then
        AddItem(skName, skImageIndex);

        if sl.Count > 0 then
        Result := sl[0]
        else
        Result := '';

        stl.Sort;
        if not (sl is TStringList) then begin
        sl.Assign(stl);
        FreeAndNil(stl);
        end;
        end;

        #56018
        HeDiBo
        Participant
          'Support' wrote:

          You are right, additional data has been added (ImageIndex).

          I will add a new parameter in the next release: “CreateDataObject: boolean = False”

          This data will not be added if CreateDataObject is False (default value).

          If you have a sources of the package you can replace this function in the sSkinManager.pas right now

          There's no such thing as a quick fix,

          Your patch is incompatible with the call in acSelectSkin.pas. The two default parameters should be exchanged.

          #56020
          Support
          Keymaster

            You are right, thank you. “False” as second parameter should be added there.

            #56021
            HeDiBo
            Participant
              'Support' wrote:

              You are right, thank you. “False” as second parameter should be added there.

              If you make CreateDataObject the third parameter here, nothing else has to change.

            Viewing 5 posts - 1 through 5 (of 5 total)
            • You must be logged in to reply to this topic.