mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-08 08:36:17 +02:00
Qt5, Qt6: guard TQtWSWinControl.SetText from dangling pointers in same way as TQtWSWinControl.GetText
(cherry picked from commit f2f43ea7fa
)
Co-authored-by: Željan Rikalo <zeljko@lazarus-ide.org>
This commit is contained in:
parent
342f30c518
commit
0e38dd49d1
@ -360,6 +360,8 @@ var
|
||||
begin
|
||||
if not WSCheckHandleAllocated(AWincontrol, 'SetText') then
|
||||
Exit;
|
||||
if not QtWidgetSet.IsValidHandle(AWinControl.Handle) then
|
||||
exit;
|
||||
Wdgt := TQtWidget(AWinControl.Handle);
|
||||
Wdgt.BeginUpdate;
|
||||
Wdgt.setText(AText{%H-});
|
||||
|
@ -358,6 +358,8 @@ var
|
||||
begin
|
||||
if not WSCheckHandleAllocated(AWincontrol, 'SetText') then
|
||||
Exit;
|
||||
if not QtWidgetSet.IsValidHandle(AWinControl.Handle) then
|
||||
exit;
|
||||
Wdgt := TQtWidget(AWinControl.Handle);
|
||||
Wdgt.BeginUpdate;
|
||||
Wdgt.setText(AText{%H-});
|
||||
|
Loading…
Reference in New Issue
Block a user