mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2026-01-04 21:30:41 +01:00
Qt: fixed rare crash with QClipboard because we are freeing QClipboardH which is owned by QApplication
git-svn-id: trunk@34640 -
This commit is contained in:
parent
ba86e46415
commit
df8e36b1c7
@ -583,6 +583,7 @@ type
|
||||
constructor Create; override;
|
||||
destructor Destroy; override;
|
||||
procedure AttachEvents; override;
|
||||
procedure DetachEvents; override;
|
||||
function EventFilter(Sender: QObjectH; Event: QEventH): Boolean; cdecl; override;
|
||||
|
||||
function Clipboard: QClipboardH; inline;
|
||||
@ -3827,6 +3828,8 @@ begin
|
||||
FSelTimer.Free;
|
||||
{$ENDIF}
|
||||
FClipBoardFormats.Free;
|
||||
// This is global QApplication object so do NOT destroy it !!
|
||||
TheObject := nil;
|
||||
inherited Destroy;
|
||||
end;
|
||||
|
||||
@ -3842,6 +3845,19 @@ begin
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
procedure TQtClipboard.DetachEvents;
|
||||
begin
|
||||
if Assigned(FClipDataChangedHook) then
|
||||
QClipboard_hook_destroy(FClipDataChangedHook);
|
||||
FClipDataChangedHook := nil;
|
||||
{$IFDEF HASX11}
|
||||
if Assigned(FClipSelectionChangedHook) then
|
||||
QClipboard_hook_destroy(FClipSelectionChangedHook);
|
||||
FClipSelectionChangedHook := nil;
|
||||
{$ENDIF}
|
||||
inherited DetachEvents;
|
||||
end;
|
||||
|
||||
procedure TQtClipboard.signalDataChanged; cdecl;
|
||||
begin
|
||||
{$IFDEF VERBOSE_QT_CLIPBOARD}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user