Cocoa/ListView: in vsReport, memory management improved

This commit is contained in:
rich2014 2024-08-11 15:12:37 +08:00
parent 87b0dfc5c9
commit 2e87241071

View File

@ -105,6 +105,7 @@ type
procedure backend_onInit;
public
procedure addSubview(aView: NSView); override;
procedure dealloc; override;
procedure lclSetProcessor( processor: TCocoaTableViewProcessor ); message 'lclSetProcessor:';
procedure lclSetCheckBoxes( checkBoxes: Boolean); message 'lclSetCheckBoxes:';
@ -329,10 +330,10 @@ begin
end;
end;
function AllocCocoaTableListView: TCocoaTableListView; // init will happen outside
function AllocCocoaTableListView: TCocoaTableListView;
begin
// init will happen outside
Result := TCocoaTableListView.alloc;
Result.setRowSizeStyle( NSTableViewRowSizeStyleCustom );
end;
procedure TCocoaTableRowView.drawRect(dirtyRect: NSRect);
@ -412,6 +413,11 @@ begin
inherited addSubview(aView);
end;
procedure TCocoaTableListView.dealloc;
begin
FreeAndNil( _processor );
end;
procedure TCocoaTableListView.lclSetProcessor( processor: TCocoaTableViewProcessor);
begin
_processor:= processor;