From 27245ea6de427f9ae7ef042d4739e00698983cde Mon Sep 17 00:00:00 2001 From: Chris Bracken Date: Fri, 23 Feb 2018 16:35:32 -0800 Subject: [PATCH] Don't release on CFRef::Reset() to same instance (flutter/engine#4709) --- engine/src/flutter/fml/platform/darwin/cf_utils.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/engine/src/flutter/fml/platform/darwin/cf_utils.h b/engine/src/flutter/fml/platform/darwin/cf_utils.h index e3e26adaed..b5a3d07441 100644 --- a/engine/src/flutter/fml/platform/darwin/cf_utils.h +++ b/engine/src/flutter/fml/platform/darwin/cf_utils.h @@ -26,6 +26,9 @@ class CFRef { } void Reset(T instance) { + if (instance_ == instance) { + return; + } if (instance_ != nullptr) { CFRelease(instance_); }