lcl gtk: fixed mem leak

git-svn-id: trunk@63635 -
This commit is contained in:
mattias 2020-07-23 16:27:10 +00:00
parent 9ce85ae018
commit b45ee007da
2 changed files with 40 additions and 37 deletions

View File

@ -1444,8 +1444,7 @@ begin
{$ENDIF}
If RGN = nil then
Result := ERROR
else
If gdk_region_empty(RGN) then
else if gdk_region_empty(RGN) then
Result := NULLREGION
else begin
gdk_region_get_clipbox(RGN,@aRect);

View File

@ -1838,9 +1838,14 @@ begin
and IsValidGDIObject(Src2);
if not Continue then begin
DebugLn('WARNING: [TGtk2WidgetSet.CombineRgn] Invalid HRGN');
Result := Error;
end
else begin
exit(Error);
end;
if DObj^.RefCount>1 then
begin
DebugLn('WARNING: [TGtk2WidgetSet.CombineRgn] Invalid Dest');
exit(RegionType(DObj^.GDIRegionObject));
end;
S1 := S1Obj^.GDIRegionObject;
S2 := S2Obj^.GDIRegionObject;
//DebugLn('TGtk2WidgetSet.CombineRgn A fnCombineMode=',Dbgs(fnCombineMode));
@ -1866,14 +1871,13 @@ begin
Result := RegionType(D);
//DebugLn('TGtk2WidgetSet.CombineRgn B Mode=',dbgs(fnCombineMode),
// ' S1=',GDKRegionAsString(S1),' S2=',GDKRegionAsString(S2),' D=',GDKRegionAsString(D),'');
if (Result = NullRegion) and
{if (Result = NullRegion) and
((RegionType(S1) <> NullRegion) or ((RegionType(S2) <> NullRegion))) then
begin
DeleteObject(Dest);
Dest := CreateEmptyRegion;
Result := RegionType(D);
end;
end;
Result := RegionType(Dest);
end;}
end;
{------------------------------------------------------------------------------