DescriptionMac AVFoundation: check -CrAVCaptureDevice::observationInfo before removing observers.
During Chrome shutdown, DeviceMonitorMac deallocs
CrAVFoundationDeviceObserver, which is registered as an
observer of suspended and connected events on the
CrAVCaptureDevice. Every so seldom (see bugs), the
removal of these observers causes a crash. Observers
removal seems to be a long standing problem with
Cocoa and Objective-C++.
This CL speculates with a solution for this trouble
via testing if the protocol method -observationInfo [1]
is not |nil| before removing the observers. This is
based on the observation that:
a) There might be an AVFoundation-internal race
between observer removal and AVCaptureDevice destruction.
b) A previous, unrelated Chrome crash might have
left the AVFoundation into some unstable meta state.
(This is based on xians@ hitting this bug during
browser_tests).
Tested locally and seems to work fine.
BUG=288562, 371271
[1] https://developer.apple.com/library/ios/documentation/Cocoa/Reference/Foundation/Protocols/NSKeyValueObserving_Protocol/Reference/Reference.html#jumpTo_10
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=269603
Patch Set 1 : #
Messages
Total messages: 8 (0 generated)
|