From 6aaef97158c45f75fa1d1136b26e76ff294cd107 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Mon, 19 Feb 2018 16:48:03 -0500 Subject: [PATCH] Breaks Mac machine shutdown deadlock. --- OSBindings/Mac/Clock Signal/Updater/CSBestEffortUpdater.mm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/OSBindings/Mac/Clock Signal/Updater/CSBestEffortUpdater.mm b/OSBindings/Mac/Clock Signal/Updater/CSBestEffortUpdater.mm index fdcb9dc9f..80c82bd1f 100644 --- a/OSBindings/Mac/Clock Signal/Updater/CSBestEffortUpdater.mm +++ b/OSBindings/Mac/Clock Signal/Updater/CSBestEffortUpdater.mm @@ -16,8 +16,10 @@ struct UpdaterDelegate: public Concurrency::BestEffortUpdater::Delegate { void update(Concurrency::BestEffortUpdater *updater, int cycles, bool did_skip_previous_update) { [delegateLock lock]; - [delegate bestEffortUpdater:nil runForCycles:(NSUInteger)cycles didSkipPreviousUpdate:did_skip_previous_update]; + __weak id delegateCopy = delegate; [delegateLock unlock]; + + [delegateCopy bestEffortUpdater:nil runForCycles:(NSUInteger)cycles didSkipPreviousUpdate:did_skip_previous_update]; } };