mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-05 15:57:18 +01:00
cocoa: preventing range check error on a tab removal
git-svn-id: trunk@61424 -
This commit is contained in:
parent
285f0d4cb6
commit
860c292e15
@ -585,11 +585,11 @@ end;
|
|||||||
class procedure TCocoaWSCustomPage.DestroyHandle(const AWinControl: TWinControl);
|
class procedure TCocoaWSCustomPage.DestroyHandle(const AWinControl: TWinControl);
|
||||||
var
|
var
|
||||||
tv: TCocoaTabPageView;
|
tv: TCocoaTabPageView;
|
||||||
ndx: Integer;
|
ndx: NSInteger;
|
||||||
begin
|
begin
|
||||||
tv := TCocoaTabPageView(AWinControl.Handle);
|
tv := TCocoaTabPageView(AWinControl.Handle);
|
||||||
ndx := tv.tabView.exttabIndexOfTabViewItem(tv.tabPage);
|
ndx := tv.tabView.exttabIndexOfTabViewItem(tv.tabPage);
|
||||||
if ndx >= 0 then
|
if (ndx >= 0) and (ndx < tv.tabView.fulltabs.count) then
|
||||||
tv.tabview.exttabRemoveTabViewItem(tv.tabPage);
|
tv.tabview.exttabRemoveTabViewItem(tv.tabPage);
|
||||||
TCocoaWSWinControl.DestroyHandle(AWinControl);
|
TCocoaWSWinControl.DestroyHandle(AWinControl);
|
||||||
end;
|
end;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user