mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
FIX: Crash under GTK2 (fixes #2069)
This commit is contained in:
parent
026e9755d8
commit
2a2862c0f1
1 changed files with 10 additions and 1 deletions
|
|
@ -1228,10 +1228,19 @@ end;
|
|||
function TPixMapManager.AddDefaultThemePixmap(const AIconName: String;
|
||||
AIconSize: Integer): PtrInt;
|
||||
var
|
||||
bmpBitmap: Graphics.TBitmap;
|
||||
bmpBitmap: Pointer;
|
||||
{$IF DEFINED(LCLGTK2)}
|
||||
sIconFileName: String;
|
||||
{$ENDIF}
|
||||
begin
|
||||
if AIconSize = 0 then AIconSize := gIconsSize;
|
||||
{$IF DEFINED(LCLGTK2)}
|
||||
sIconFileName := FDCIconTheme.FindIcon(AIconName, AIconSize);
|
||||
if Length(sIconFileName) = 0 then Exit(-1);
|
||||
bmpBitmap := gdk_pixbuf_new_from_file_at_size(PChar(sIconFileName), AIconSize, AIconSize, nil);
|
||||
{$ELSE}
|
||||
bmpBitmap := LoadThemeIcon(FDCIconTheme, AIconName, AIconSize);
|
||||
{$ENDIF}
|
||||
if (bmpBitmap = nil) then
|
||||
Result := -1
|
||||
else begin
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue