diff --git a/lcl/interfaces/cocoa/cocoatables.pas b/lcl/interfaces/cocoa/cocoatables.pas index 2f79cc708d..c4202b0308 100644 --- a/lcl/interfaces/cocoa/cocoatables.pas +++ b/lcl/interfaces/cocoa/cocoatables.pas @@ -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;