diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterEngine.mm b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterEngine.mm index 713d4fd0e2..b87195f59f 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterEngine.mm +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterEngine.mm @@ -125,7 +125,6 @@ static constexpr int kNumProfilerSamplesPerSec = 5; std::shared_ptr _platformViewsController; flutter::IOSRenderingAPI _renderingApi; - std::shared_ptr _profiler_metrics; std::shared_ptr _profiler; // Channels @@ -570,10 +569,13 @@ static constexpr int kNumProfilerSamplesPerSec = 5; - (void)startProfiler { FML_DCHECK(!_threadHost->name_prefix.empty()); - _profiler_metrics = std::make_shared(); _profiler = std::make_shared( _threadHost->name_prefix.c_str(), _threadHost->profiler_thread->GetTaskRunner(), - [self]() { return self->_profiler_metrics->GenerateSample(); }, kNumProfilerSamplesPerSec); + []() { + flutter::ProfilerMetricsIOS profiler_metrics; + return profiler_metrics.GenerateSample(); + }, + kNumProfilerSamplesPerSec); _profiler->Start(); } @@ -1486,7 +1488,6 @@ static void SetEntryPoint(flutter::Settings* settings, NSString* entrypoint, NSS result->_threadHost = _threadHost; result->_profiler = _profiler; - result->_profiler_metrics = _profiler_metrics; result->_isGpuDisabled = _isGpuDisabled; [result setUpShell:std::move(shell) withVMServicePublication:NO]; return [result autorelease];