Skip to content

Commit

Permalink
Update src/video/cocoa/wnd_quartz.mm
Browse files Browse the repository at this point in the history
Co-Authored-By: Michael Lutz <michi@icosahedron.de>
  • Loading branch information
andythenorth and michicc committed Sep 7, 2019
1 parent f65cc0e commit 38b1277
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/video/cocoa/wnd_quartz.mm
Expand Up @@ -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;
Expand Down

3 comments on commit 38b1277

@SoothedTau
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@michicc
Copy link
Member

@michicc michicc commented on 38b1277 Sep 7, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@SoothedTau
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.