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:
zeljko 2011-05-03 14:23:43 +00:00
parent 3a9c073d32
commit fc8550cf53

View File

@ -754,11 +754,10 @@ begin
cx := x;
cy := y;
end;
Pixmap := TQtPixmap.Create(@DCSize);
if Context.Parent <> nil then
begin
Pixmap := TQtPixmap.Create(@DCSize);
WinID := QWidget_winId(Context.Parent);
try
// if you have dual monitors then getDeviceSize return
@ -779,6 +778,13 @@ begin
if Context.vImage <> nil then
RawImage_FromImage(Context.vImage.Handle)
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;
end;