mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-29 06:49:27 +02:00
cocoa: Patch from issue #28511 potential listview mem leak
git-svn-id: trunk@49631 -
This commit is contained in:
parent
758c2b909b
commit
ffae572f14
@ -560,11 +560,18 @@ begin
|
|||||||
WriteLn('[TCocoaWSCustomListView.CreateHandle] AWinControl='+IntToStr(PtrInt(AWinControl)));
|
WriteLn('[TCocoaWSCustomListView.CreateHandle] AWinControl='+IntToStr(PtrInt(AWinControl)));
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
lCocoaLV := TCocoaListView.alloc.lclInitWithCreateParams(AParams);
|
lCocoaLV := TCocoaListView.alloc.lclInitWithCreateParams(AParams);
|
||||||
ns := GetNSRect(0, 0, AParams.Width, AParams.Height);
|
|
||||||
lTableLV := TCocoaTableListView.alloc.initWithFrame(ns);
|
|
||||||
Result := TLCLIntfHandle(lCocoaLV);
|
Result := TLCLIntfHandle(lCocoaLV);
|
||||||
if Result <> 0 then
|
if Result <> 0 then
|
||||||
begin
|
begin
|
||||||
|
ns := GetNSRect(0, 0, AParams.Width, AParams.Height);
|
||||||
|
lTableLV := TCocoaTableListView.alloc.initWithFrame(ns);
|
||||||
|
if lTableLV = nil then
|
||||||
|
begin
|
||||||
|
lCocoaLV.dealloc;
|
||||||
|
Result := 0;
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
|
||||||
// Unintuitive things about NSTableView which caused a lot of headaches:
|
// Unintuitive things about NSTableView which caused a lot of headaches:
|
||||||
// 1-> The column header appears only if the NSTableView is inside a NSScrollView
|
// 1-> The column header appears only if the NSTableView is inside a NSScrollView
|
||||||
// 2-> To get proper scrolling use NSScrollView.setDocumentView instead of addSubview
|
// 2-> To get proper scrolling use NSScrollView.setDocumentView instead of addSubview
|
||||||
|
Loading…
Reference in New Issue
Block a user