diff --git a/shell/platform/darwin/ios/framework/Source/FlutterEngine.mm b/shell/platform/darwin/ios/framework/Source/FlutterEngine.mm index 713d4fd0e288f..b87195f59f6ad 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterEngine.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterEngine.mm @@ -125,7 +125,6 @@ @implementation FlutterEngine { std::shared_ptr _platformViewsController; flutter::IOSRenderingAPI _renderingApi; - std::shared_ptr _profiler_metrics; std::shared_ptr _profiler; // Channels @@ -570,10 +569,13 @@ - (void)resetChannels { - (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 @@ - (FlutterEngine*)spawnWithEntrypoint:(/*nullable*/ NSString*)entrypoint result->_threadHost = _threadHost; result->_profiler = _profiler; - result->_profiler_metrics = _profiler_metrics; result->_isGpuDisabled = _isGpuDisabled; [result setUpShell:std::move(shell) withVMServicePublication:NO]; return [result autorelease];