mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-13 02:49:06 +02:00
Qt: fixed crash in TQtWidgetSet.RawImage_FromDevice(), also fixed memleak with created TQtPixmap. issue #19281
git-svn-id: trunk@30540 -
This commit is contained in:
parent
3a9c073d32
commit
fc8550cf53
@ -754,11 +754,10 @@ begin
|
|||||||
cx := x;
|
cx := x;
|
||||||
cy := y;
|
cy := y;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Pixmap := TQtPixmap.Create(@DCSize);
|
|
||||||
|
|
||||||
if Context.Parent <> nil then
|
if Context.Parent <> nil then
|
||||||
begin
|
begin
|
||||||
|
Pixmap := TQtPixmap.Create(@DCSize);
|
||||||
WinID := QWidget_winId(Context.Parent);
|
WinID := QWidget_winId(Context.Parent);
|
||||||
try
|
try
|
||||||
// if you have dual monitors then getDeviceSize return
|
// if you have dual monitors then getDeviceSize return
|
||||||
@ -779,6 +778,13 @@ begin
|
|||||||
if Context.vImage <> nil then
|
if Context.vImage <> nil then
|
||||||
RawImage_FromImage(Context.vImage.Handle)
|
RawImage_FromImage(Context.vImage.Handle)
|
||||||
else
|
else
|
||||||
|
if Context.ParentPixmap <> nil then
|
||||||
|
begin
|
||||||
|
Image := QImage_create();
|
||||||
|
QPixmap_toImage(Context.ParentPixmap, Image);
|
||||||
|
RawImage_FromImage(Image);
|
||||||
|
QImage_destroy(Image);
|
||||||
|
end else
|
||||||
Result := False;
|
Result := False;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user