mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-29 10:52:22 +02:00
Cocoa/ListView: Try to fix the crash caused by Cocoa internal parameter exception during NSTableView initialization on macOS 10.14, #41133
This commit is contained in:
parent
43324b497f
commit
f27ab84322
@ -70,6 +70,8 @@ type
|
||||
NSTableViewDelegateProtocol,
|
||||
NSTableViewDataSourceProtocol,
|
||||
TCocoaListViewBackendControlProtocol )
|
||||
private
|
||||
_coocaInitializing: Boolean;
|
||||
private
|
||||
_processor: TCocoaTableViewProcessor;
|
||||
_checkBoxes: Boolean;
|
||||
@ -632,6 +634,13 @@ var
|
||||
begin
|
||||
inherited;
|
||||
|
||||
// NSTableView.initWithFrame() will call setNeedsDisplayInRect()
|
||||
// at this time, calling rowsInRect() will crash on macOS 10.14.
|
||||
// it seems that this issue does not exist on other macOS versions.
|
||||
// FYI: https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/41133
|
||||
if _coocaInitializing then
|
||||
Exit;
|
||||
|
||||
rowRange := self.rowsInRect( invalidRect );
|
||||
if rowRange.length = 0 then
|
||||
Exit;;
|
||||
@ -718,7 +727,9 @@ end;
|
||||
|
||||
function TCocoaTableListView.initWithFrame(frameRect: NSRect): id;
|
||||
begin
|
||||
_coocaInitializing:= True;
|
||||
Result:=inherited initWithFrame(frameRect);
|
||||
_coocaInitializing:= False;
|
||||
if NSAppkitVersionNumber >= NSAppKitVersionNumber11_0 then
|
||||
setStyle( CocoaConfigListView.vsReport.tableViewStyle );
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user