Skip to content
Permalink
Browse files

Update src/video/cocoa/wnd_quartz.mm

Co-Authored-By: Michael Lutz <michi@icosahedron.de>
  • Loading branch information
andythenorth and michicc committed Sep 7, 2019
1 parent f65cc0e commit 38b1277655f930b41ee061f33c033c475bed762c
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/video/cocoa/wnd_quartz.mm
@@ -289,7 +289,9 @@ - (void)drawRect:(NSRect)invalidRect
styleMask:style
backing:NSBackingStoreBuffered
defer:NO ];
[ this->window setColorSpace: [ [ [ NSColorSpace alloc ] initWithCGColorSpace:QZ_GetCorrectColorSpace() ] autorelease ] ];
if ([ this->window respondsToSelector:@selector(setColorSpace:) ]) {
[ this->window setColorSpace:[ [ [ NSColorSpace alloc ] initWithCGColorSpace:QZ_GetCorrectColorSpace() ] autorelease ] ];
}
if (this->window == nil) {
DEBUG(driver, 0, "Could not create the Cocoa window.");
this->setup = false;

3 comments on commit 38b1277

@SoothedTau

This comment has been minimized.

Copy link

SoothedTau replied Sep 7, 2019

I placed this change above the check for nil. It should probably be after that to prevent a crash when window = nil.

@michicc

This comment has been minimized.

Copy link
Member Author

michicc replied Sep 7, 2019

In Objective-C, calling a selector on NULL is allowed and just does nothing.

@SoothedTau

This comment has been minimized.

Copy link

SoothedTau replied Sep 8, 2019

In Objective-C, calling a selector on NULL is allowed and just does nothing.

Ah, I was not aware. Thanks!

Please sign in to comment.
You can’t perform that action at this time.