diff options
author | Stefano Pigozzi <stefano.pigozzi@gmail.com> | 2015-03-07 19:27:13 +0100 |
---|---|---|
committer | Stefano Pigozzi <stefano.pigozzi@gmail.com> | 2015-03-07 19:28:00 +0100 |
commit | 678cd30904490e1d898234d6f90d7c78bb34ba87 (patch) | |
tree | 74311505f78846dccc4913a4b75842f5d4d9a2b0 /video/out/cocoa_common.m | |
parent | 1bab7f69aeb1ee80fdd2f75d7658cd5fef7ee2e3 (diff) | |
download | mpv-678cd30904490e1d898234d6f90d7c78bb34ba87.tar.bz2 mpv-678cd30904490e1d898234d6f90d7c78bb34ba87.tar.xz |
cocoa: don't uninit light sensor if not present
Diffstat (limited to 'video/out/cocoa_common.m')
-rw-r--r-- | video/out/cocoa_common.m | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/video/out/cocoa_common.m b/video/out/cocoa_common.m index a706467dc2..be67a60f5a 100644 --- a/video/out/cocoa_common.m +++ b/video/out/cocoa_common.m @@ -226,8 +226,10 @@ static void cocoa_init_light_sensor(struct vo *vo) static void cocoa_uninit_light_sensor(struct vo_cocoa_state *s) { - IONotificationPortDestroy(s->light_sensor_io_port); - IOObjectRelease(s->light_sensor); + if (s->light_sensor_io_port) { + IONotificationPortDestroy(s->light_sensor_io_port); + IOObjectRelease(s->light_sensor); + } } int vo_cocoa_init(struct vo *vo) |