Fix use-after-free bug if beginBackgroundTaskWithExpirationHandler returns UIBackgroundTaskInvalid
In this case UIApplication doesn't retain block, and at the end of constructor ref_count of |this| will be decremented to zero -> |this| will be deleted. Later deleted object will be accessed in |core_(new ScopedCriticalAction::Core())| The solution is to separate object construction and beginBackgroundTaskWithExpirationHandler method call. Change-Id: I0aa21cba2396231ea9ccd3ee34617f5d0417dbdd Reviewed-on: https://chromium-review.googlesource.com/558245Reviewed-by:Sylvain Defresne <sdefresne@chromium.org> Commit-Queue: Sylvain Defresne <sdefresne@chromium.org> Cr-Commit-Position: refs/heads/master@{#485582}
Showing
Please register or sign in to comment