mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-05-31 04:32:30 +02:00
Qt: fix possible caret crash
git-svn-id: trunk@12246 -
This commit is contained in:
parent
946941c1a6
commit
1fdddb7bd2
@ -341,7 +341,6 @@ end;
|
||||
|
||||
procedure TEmulatedCaret.SetPos(const Value: TQtPoint);
|
||||
begin
|
||||
|
||||
if (FWidget = nil) or (FWidget.Widget = nil) then
|
||||
begin
|
||||
FPos.X := 0;
|
||||
@ -438,13 +437,13 @@ procedure TEmulatedCaret.UpdateCaret;
|
||||
var
|
||||
R: TRect;
|
||||
begin
|
||||
if (FWidget <> nil) and (FWidget.Widget <> nil) then
|
||||
if (FWidget <> nil) then
|
||||
begin
|
||||
R.Left := FPos.x;
|
||||
R.Top := FPos.y;
|
||||
R.Right := R.Left + FWidth + 2;
|
||||
R.Bottom := R.Top + FHeight + 2;
|
||||
if FWidget.Context = 0 then
|
||||
if (FWidget.Context = 0) and (FWidget.Widget <> nil) then
|
||||
begin
|
||||
if not EqualRect(FOldRect, R) then
|
||||
FWidget.Update(@FOldRect);
|
||||
|
@ -1123,6 +1123,9 @@ begin
|
||||
|
||||
QCursor_destroy(FDefaultCursor);
|
||||
|
||||
if HasCaret then
|
||||
DestroyCaret;
|
||||
|
||||
if (Widget <> nil) and FOwnWidget then
|
||||
QWidget_destroy(QWidgetH(Widget));
|
||||
Widget := nil;
|
||||
|
Loading…
Reference in New Issue
Block a user