diff options
| author | Manolo Gouy <Manolo> | 2018-09-30 13:46:13 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2018-09-30 13:46:13 +0000 |
| commit | 08910b74ac65e5c86e3176b455392b72e1fe158f (patch) | |
| tree | aae1a03a685bc3c962e1a76f1a1bbfde7b3376b0 /src | |
| parent | f76d2a2bf8c35c0c313f05bbd6deda49dd344efc (diff) | |
macOS: check for non-nil image before using it as miniaturized window icon.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13058 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
| -rw-r--r-- | src/Fl_cocoa.mm | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm index fb8414de1..a1ff47431 100644 --- a/src/Fl_cocoa.mm +++ b/src/Fl_cocoa.mm @@ -1281,10 +1281,12 @@ static FLWindowDelegate *flwindowdelegate_instance = nil; // capture the window and its subwindows and use as miniature window image Fl_Window *window = [nsw getFl_Window]; NSBitmapImageRep *bitmap = rect_to_NSBitmapImageRep(window, 0, 0, window->w(), window->h()); - NSImage *img = [[[NSImage alloc] initWithSize:NSMakeSize([bitmap pixelsWide], [bitmap pixelsHigh])] autorelease]; - [img addRepresentation:bitmap]; - [bitmap release]; - [nsw setMiniwindowImage:img]; + if (bitmap) { + NSImage *img = [[[NSImage alloc] initWithSize:NSMakeSize([bitmap pixelsWide], [bitmap pixelsHigh])] autorelease]; + [img addRepresentation:bitmap]; + [bitmap release]; + [nsw setMiniwindowImage:img]; + } } fl_unlock_function(); } |
