mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-07 09:40:21 +02:00
SynEdit: Fixes a crash, PrimarySelection would make a callback to a destroyed SynEdit
git-svn-id: trunk@18848 -
This commit is contained in:
parent
a8f8934f62
commit
130c399660
@ -430,9 +430,8 @@ type
|
||||
fChangeStamp: int64;
|
||||
{$ENDIF}
|
||||
|
||||
{$IFDEF SYN_LAZARUS}
|
||||
procedure AquirePrimarySelection;
|
||||
{$ENDIF}
|
||||
procedure SurrenderPrimarySelection;
|
||||
procedure BookMarkOptionsChanged(Sender: TObject);
|
||||
procedure ComputeCaret(X, Y: Integer);
|
||||
procedure DoBlockIndent;
|
||||
@ -1161,7 +1160,6 @@ end;
|
||||
|
||||
{ TCustomSynEdit }
|
||||
|
||||
{$IFDEF SYN_LAZARUS}
|
||||
procedure TCustomSynEdit.AquirePrimarySelection;
|
||||
var
|
||||
FormatList: TClipboardFormat;
|
||||
@ -1175,7 +1173,12 @@ begin
|
||||
except
|
||||
end;
|
||||
end;
|
||||
{$ENDIF}
|
||||
|
||||
procedure TCustomSynEdit.SurrenderPrimarySelection;
|
||||
begin
|
||||
if PrimarySelection.OnRequest=@PrimarySelectionRequest then
|
||||
PrimarySelection.OnRequest:=nil;
|
||||
end;
|
||||
|
||||
function TCustomSynEdit.PixelsToRowColumn(Pixels: TPoint): TPoint;
|
||||
// converts the client area coordinate
|
||||
@ -1619,6 +1622,7 @@ destructor TCustomSynEdit.Destroy;
|
||||
var
|
||||
i: integer;
|
||||
begin
|
||||
SurrenderPrimarySelection;
|
||||
{$IFDEF SYN_LAZARUS}
|
||||
if HandleAllocated then LCLIntf.DestroyCaret(Handle);
|
||||
Beautifier:=nil;
|
||||
@ -7978,10 +7982,7 @@ begin
|
||||
{$IFDEF EnableDoubleBuf}
|
||||
FreeAndNil(BufferBitmap);
|
||||
{$ENDIF}
|
||||
{$IFDEF SYN_LAZARUS}
|
||||
if PrimarySelection.OnRequest=@PrimarySelectionRequest then
|
||||
PrimarySelection.OnRequest:=nil;
|
||||
{$ENDIF}
|
||||
SurrenderPrimarySelection;
|
||||
inherited DestroyWnd;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user