Repository: flutter
Issue: Tiny memory leak in embedder interface
Labels: engine,e: embedder,perf: memory,P2,team-engine,triaged-engine

### Steps to reproduce

1. Run a custom flutter embedder with leak sanitizer

### Expected results

No memory is leaked

https://github.com/flutter/engine/blob/f7668afbd88edeae15dc28e1879f0985c366e4d5/shell/platform/embedder/embedder.cc#L917-L926

### Actual results

LeakSanitizer reports a memory leak of 16 bytes becuase the `delete` operator is used to delete a `std::unique_ptr` guarded pointer.

### Code sample

See this code snippet here:

https://github.com/flutter/engine/blob/f7668afbd88edeae15dc28e1879f0985c366e4d5/shell/platform/embedder/embedder.cc#L917-L926

In Line 917, a `std::unique_ptr` is allocated, using `std::make_unique`. This allocates an instance of `Captures`, **plus some internal data**. In line 925, the `delete` operator is used to delete the instance which was previously captured in the `unique_ptr`.

This causes a memory leak of 16 byte.

### Logs

<details open><summary>Logs</summary>

```console
=================================================================
==2840363==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 16 byte(s) in 1 object(s) allocated from:
    #0 0x55555573aca9 in malloc /rustc/llvm/src/llvm-project/compiler-rt/lib/lsan/lsan_interceptors.cpp:75:3
    #1 0x7ffff0fc54ec in operator new(unsigned long) /nix/store/z4psshvfg8dvsnsn4jlyh3ib4f6nn0ch-flutter-engine-debug-unopt-c9b9d5780da342eb3f0f5e439a7db06f7d112575/out/host_debug_unopt/../../../../../build/flutter-engine-source-c9b9d5780da342eb3f0f5e439a7db06f7d112575-x86_64-linux-x86_64-linux/src/flutter/third_party/libcxx/src/new.cpp:67:17
    #2 0x7ffff0e89e50 in std::_fl::__unique_if<MakeSkSurfaceFromBackingStore(GrDirectContext*, FlutterBackingStoreConfig const&, FlutterSoftwareBackingStore2 const*)::Captures>::__unique_single std::_fl::make_unique[abi:v15000]<MakeSkSurfaceFromBackingStore(GrDirectContext*, FlutterBackingStoreConfig const&, FlutterSoftwareBackingStore2 const*)::Captures>() /nix/store/z4psshvfg8dvsnsn4jlyh3ib4f6nn0ch-flutter-engine-debug-unopt-c9b9d5780da342eb3f0f5e439a7db06f7d112575/out/host_debug_unopt/../../../../../build/flutter-engine-source-c9b9d5780da342eb3f0f5e439a7db06f7d112575-x86_64-linux-x86_64-linux/src/flutter/third_party/libcxx/include/__memory/unique_ptr.h:714:28
    #3 0x7ffff0e86cd5 in MakeSkSurfaceFromBackingStore(GrDirectContext*, FlutterBackingStoreConfig const&, FlutterSoftwareBackingStore2 const*) /nix/store/z4psshvfg8dvsnsn4jlyh3ib4f6nn0ch-flutter-engine-debug-unopt-c9b9d5780da342eb3f0f5e439a7db06f7d112575/out/host_debug_unopt/../../../../../build/flutter-engine-source-c9b9d5780da342eb3f0f5e439a7db06f7d112575-x86_64-linux-x86_64-linux/src/flutter/shell/platform/embedder/embedder.cc:921:19
    #4 0x7ffff0e8592b in CreateEmbedderRenderTarget(FlutterCompositor const*, FlutterBackingStoreConfig const&, GrDirectContext*, std::_fl::shared_ptr<impeller::AiksContext> const&, bool) /nix/store/z4psshvfg8dvsnsn4jlyh3ib4f6nn0ch-flutter-engine-debug-unopt-c9b9d5780da342eb3f0f5e439a7db06f7d112575/out/host_debug_unopt/../../../../../build/flutter-engine-source-c9b9d5780da342eb3f0f5e439a7db06f7d112575-x86_64-linux-x86_64-linux/src/flutter/shell/platform/embedder/embedder.cc:1278:27
    #5 0x7ffff0e85140 in _ZZL33InferExternalViewEmbedderFromArgsPK17FlutterCompositorbENK3$_0clI25FlutterBackingStoreConfigEEDaP15GrDirectContextRKNSt3_fl10shared_ptrIN8impeller11AiksContextEEERKT_ /nix/store/z4psshvfg8dvsnsn4jlyh3ib4f6nn0ch-flutter-engine-debug-unopt-c9b9d5780da342eb3f0f5e439a7db06f7d112575/out/host_debug_unopt/../../../../../build/flutter-engine-source-c9b9d5780da342eb3f0f5e439a7db06f7d112575-x86_64-linux-x86_64-linux/src/flutter/shell/platform/embedder/embedder.cc:1353:20
    #6 0x7ffff0e850ea in decltype(std::declval<InferExternalViewEmbedderFromArgs(FlutterCompositor const*, bool)::$_0&>()(std::declval<GrDirectContext*>(), std::declval<std::_fl::shared_ptr<impeller::AiksContext> const&>(), std::declval<FlutterBackingStoreConfig const&>())) std::_fl::__invoke[abi:v15000]<InferExternalViewEmbedderFromArgs(FlutterCompositor const*, bool)::$_0&, GrDirectContext*, std::_fl::shared_ptr<impeller::AiksContext> const&, FlutterBackingStoreConfig const&>(InferExternalViewEmbedderFromArgs(FlutterCompositor const*, bool)::$_0&, GrDirectContext*&&, std::_fl::shared_ptr<impeller::AiksContext> const&, FlutterBackingStoreConfig const&) /nix/store/z4psshvfg8dvsnsn4jlyh3ib4f6nn0ch-flutter-engine-debug-unopt-c9b9d5780da342eb3f0f5e439a7db06f7d112575/out/host_debug_unopt/../../../../../build/flutter-engine-source-c9b9d5780da342eb3f0f5e439a7db06f7d112575-x86_64-linux-x86_64-linux/src/flutter/third_party/libcxx/include/__functional/invoke.h:403:23
    #7 0x7ffff0e85077 in std::_fl::unique_ptr<flutter::EmbedderRenderTarget, std::_fl::default_delete<flutter::EmbedderRenderTarget>> std::_fl::__invoke_void_return_wrapper<std::_fl::unique_ptr<flutter::EmbedderRenderTarget, std::_fl::default_delete<flutter::EmbedderRenderTarget>>, false>::__call<InferExternalViewEmbedderFromArgs(FlutterCompositor const*, bool)::$_0&, GrDirectContext*, std::_fl::shared_ptr<impeller::AiksContext> const&, FlutterBackingStoreConfig const&>(InferExternalViewEmbedderFromArgs(FlutterCompositor const*, bool)::$_0&, GrDirectContext*&&, std::_fl::shared_ptr<impeller::AiksContext> const&, FlutterBackingStoreConfig const&) /nix/store/z4psshvfg8dvsnsn4jlyh3ib4f6nn0ch-flutter-engine-debug-unopt-c9b9d5780da342eb3f0f5e439a7db06f7d112575/out/host_debug_unopt/../../../../../build/flutter-engine-source-c9b9d5780da342eb3f0f5e439a7db06f7d112575-x86_64-linux-x86_64-linux/src/flutter/third_party/libcxx/include/__functional/invoke.h:479:16
    #8 0x7ffff0e85027 in std::_fl::__function::__alloc_func<InferExternalViewEmbedderFromArgs(FlutterCompositor const*, bool)::$_0, std::_fl::allocator<InferExternalViewEmbedderFromArgs(FlutterCompositor const*, bool)::$_0>, std::_fl::unique_ptr<flutter::EmbedderRenderTarget, std::_fl::default_delete<flutter::EmbedderRenderTarget>> (GrDirectContext*, std::_fl::shared_ptr<impeller::AiksContext> const&, FlutterBackingStoreConfig const&)>::operator()[abi:v15000](GrDirectContext*&&, std::_fl::shared_ptr<impeller::AiksContext> const&, FlutterBackingStoreConfig const&) /nix/store/z4psshvfg8dvsnsn4jlyh3ib4f6nn0ch-flutter-engine-debug-unopt-c9b9d5780da342eb3f0f5e439a7db06f7d112575/out/host_debug_unopt/../../../../../build/flutter-engine-source-c9b9d5780da342eb3f0f5e439a7db06f7d112575-x86_64-linux-x86_64-linux/src/flutter/third_party/libcxx/include/__functional/function.h:185:16
    #9 0x7ffff0e8451b in std::_fl::__function::__func<InferExternalViewEmbedderFromArgs(FlutterCompositor const*, bool)::$_0, std::_fl::allocator<InferExternalViewEmbedderFromArgs(FlutterCompositor const*, bool)::$_0>, std::_fl::unique_ptr<flutter::EmbedderRenderTarget, std::_fl::default_delete<flutter::EmbedderRenderTarget>> (GrDirectContext*, std::_fl::shared_ptr<impeller::AiksContext> const&, FlutterBackingStoreConfig const&)>::operator()(GrDirectContext*&&, std::_fl::shared_ptr<impeller::AiksContext> const&, FlutterBackingStoreConfig const&) /nix/store/z4psshvfg8dvsnsn4jlyh3ib4f6nn0ch-flutter-engine-debug-unopt-c9b9d5780da342eb3f0f5e439a7db06f7d112575/out/host_debug_unopt/../../../../../build/flutter-engine-source-c9b9d5780da342eb3f0f5e439a7db06f7d112575-x86_64-linux-x86_64-linux/src/flutter/third_party/libcxx/include/__functional/function.h:359:12
    #10 0x7ffff0efd00c in std::_fl::__function::__value_func<std::_fl::unique_ptr<flutter::EmbedderRenderTarget, std::_fl::default_delete<flutter::EmbedderRenderTarget>> (GrDirectContext*, std::_fl::shared_ptr<impeller::AiksContext> const&, FlutterBackingStoreConfig const&)>::operator()[abi:v15000](GrDirectContext*&&, std::_fl::shared_ptr<impeller::AiksContext> const&, FlutterBackingStoreConfig const&) const /nix/store/z4psshvfg8dvsnsn4jlyh3ib4f6nn0ch-flutter-engine-debug-unopt-c9b9d5780da342eb3f0f5e439a7db06f7d112575/out/host_debug_unopt/../../../../../build/flutter-engine-source-c9b9d5780da342eb3f0f5e439a7db06f7d112575-x86_64-linux-x86_64-linux/src/flutter/third_party/libcxx/include/__functional/function.h:512:16
    #11 0x7ffff0efcf97 in std::_fl::function<std::_fl::unique_ptr<flutter::EmbedderRenderTarget, std::_fl::default_delete<flutter::EmbedderRenderTarget>> (GrDirectContext*, std::_fl::shared_ptr<impeller::AiksContext> const&, FlutterBackingStoreConfig const&)>::operator()(GrDirectContext*, std::_fl::shared_ptr<impeller::AiksContext> const&, FlutterBackingStoreConfig const&) const /nix/store/z4psshvfg8dvsnsn4jlyh3ib4f6nn0ch-flutter-engine-debug-unopt-c9b9d5780da342eb3f0f5e439a7db06f7d112575/out/host_debug_unopt/../../../../../build/flutter-engine-source-c9b9d5780da342eb3f0f5e439a7db06f7d112575-x86_64-linux-x86_64-linux/src/flutter/third_party/libcxx/include/__functional/function.h:1187:12
    #12 0x7ffff0ef12df in flutter::EmbedderExternalViewEmbedder::SubmitFlutterView(long, GrDirectContext*, std::_fl::shared_ptr<impeller::AiksContext> const&, std::_fl::unique_ptr<flutter::SurfaceFrame, std::_fl::default_delete<flutter::SurfaceFrame>>)::$_0::operator()(SkISize const&) const /nix/store/z4psshvfg8dvsnsn4jlyh3ib4f6nn0ch-flutter-engine-debug-unopt-c9b9d5780da342eb3f0f5e439a7db06f7d112575/out/host_debug_unopt/../../../../../build/flutter-engine-source-c9b9d5780da342eb3f0f5e439a7db06f7d112575-x86_64-linux-x86_64-linux/src/flutter/shell/platform/embedder/embedder_external_view_embedder.cc:451:12
    #13 0x7ffff0ef11c7 in decltype(std::declval<flutter::EmbedderExternalViewEmbedder::SubmitFlutterView(long, GrDirectContext*, std::_fl::shared_ptr<impeller::AiksContext> const&, std::_fl::unique_ptr<flutter::SurfaceFrame, std::_fl::default_delete<flutter::SurfaceFrame>>)::$_0&>()(std::declval<SkISize const&>())) std::_fl::__invoke[abi:v15000]<flutter::EmbedderExternalViewEmbedder::SubmitFlutterView(long, GrDirectContext*, std::_fl::shared_ptr<impeller::AiksContext> const&, std::_fl::unique_ptr<flutter::SurfaceFrame, std::_fl::default_delete<flutter::SurfaceFrame>>)::$_0&, SkISize const&>(flutter::EmbedderExternalViewEmbedder::SubmitFlutterView(long, GrDirectContext*, std::_fl::shared_ptr<impeller::AiksContext> const&, std::_fl::unique_ptr<flutter::SurfaceFrame, std::_fl::default_delete<flutter::SurfaceFrame>>)::$_0&, SkISize const&) /nix/store/z4psshvfg8dvsnsn4jlyh3ib4f6nn0ch-flutter-engine-debug-unopt-c9b9d5780da342eb3f0f5e439a7db06f7d112575/out/host_debug_unopt/../../../../../build/flutter-engine-source-c9b9d5780da342eb3f0f5e439a7db06f7d112575-x86_64-linux-x86_64-linux/src/flutter/third_party/libcxx/include/__functional/invoke.h:403:23
    #14 0x7ffff0ef1167 in std::_fl::unique_ptr<flutter::EmbedderRenderTarget, std::_fl::default_delete<flutter::EmbedderRenderTarget>> std::_fl::__invoke_void_return_wrapper<std::_fl::unique_ptr<flutter::EmbedderRenderTarget, std::_fl::default_delete<flutter::EmbedderRenderTarget>>, false>::__call<flutter::EmbedderExternalViewEmbedder::SubmitFlutterView(long, GrDirectContext*, std::_fl::shared_ptr<impeller::AiksContext> const&, std::_fl::unique_ptr<flutter::SurfaceFrame, std::_fl::default_delete<flutter::SurfaceFrame>>)::$_0&, SkISize const&>(flutter::EmbedderExternalViewEmbedder::SubmitFlutterView(long, GrDirectContext*, std::_fl::shared_ptr<impeller::AiksContext> const&, std::_fl::unique_ptr<flutter::SurfaceFrame, std::_fl::default_delete<flutter::SurfaceFrame>>)::$_0&, SkISize const&) /nix/store/z4psshvfg8dvsnsn4jlyh3ib4f6nn0ch-flutter-engine-debug-unopt-c9b9d5780da342eb3f0f5e439a7db06f7d112575/out/host_debug_unopt/../../../../../build/flutter-engine-source-c9b9d5780da342eb3f0f5e439a7db06f7d112575-x86_64-linux-x86_64-linux/src/flutter/third_party/libcxx/include/__functional/invoke.h:479:16
    #15 0x7ffff0ef1127 in std::_fl::__function::__alloc_func<flutter::EmbedderExternalViewEmbedder::SubmitFlutterView(long, GrDirectContext*, std::_fl::shared_ptr<impeller::AiksContext> const&, std::_fl::unique_ptr<flutter::SurfaceFrame, std::_fl::default_delete<flutter::SurfaceFrame>>)::$_0, std::_fl::allocator<flutter::EmbedderExternalViewEmbedder::SubmitFlutterView(long, GrDirectContext*, std::_fl::shared_ptr<impeller::AiksContext> const&, std::_fl::unique_ptr<flutter::SurfaceFrame, std::_fl::default_delete<flutter::SurfaceFrame>>)::$_0>, std::_fl::unique_ptr<flutter::EmbedderRenderTarget, std::_fl::default_delete<flutter::EmbedderRenderTarget>> (SkISize const&)>::operator()[abi:v15000](SkISize const&) /nix/store/z4psshvfg8dvsnsn4jlyh3ib4f6nn0ch-flutter-engine-debug-unopt-c9b9d5780da342eb3f0f5e439a7db06f7d112575/out/host_debug_unopt/../../../../../build/flutter-engine-source-c9b9d5780da342eb3f0f5e439a7db06f7d112575-x86_64-linux-x86_64-linux/src/flutter/third_party/libcxx/include/__functional/function.h:185:16
    #16 0x7ffff0ef063b in std::_fl::__function::__func<flutter::EmbedderExternalViewEmbedder::SubmitFlutterView(long, GrDirectContext*, std::_fl::shared_ptr<impeller::AiksContext> const&, std::_fl::unique_ptr<flutter::SurfaceFrame, std::_fl::default_delete<flutter::SurfaceFrame>>)::$_0, std::_fl::allocator<flutter::EmbedderExternalViewEmbedder::SubmitFlutterView(long, GrDirectContext*, std::_fl::shared_ptr<impeller::AiksContext> const&, std::_fl::unique_ptr<flutter::SurfaceFrame, std::_fl::default_delete<flutter::SurfaceFrame>>)::$_0>, std::_fl::unique_ptr<flutter::EmbedderRenderTarget, std::_fl::default_delete<flutter::EmbedderRenderTarget>> (SkISize const&)>::operator()(SkISize const&) /nix/store/z4psshvfg8dvsnsn4jlyh3ib4f6nn0ch-flutter-engine-debug-unopt-c9b9d5780da342eb3f0f5e439a7db06f7d112575/out/host_debug_unopt/../../../../../build/flutter-engine-source-c9b9d5780da342eb3f0f5e439a7db06f7d112575-x86_64-linux-x86_64-linux/src/flutter/third_party/libcxx/include/__functional/function.h:359:12
    #17 0x7ffff0ef4d8c in std::_fl::__function::__value_func<std::_fl::unique_ptr<flutter::EmbedderRenderTarget, std::_fl::default_delete<flutter::EmbedderRenderTarget>> (SkISize const&)>::operator()[abi:v15000](SkISize const&) const /nix/store/z4psshvfg8dvsnsn4jlyh3ib4f6nn0ch-flutter-engine-debug-unopt-c9b9d5780da342eb3f0f5e439a7db06f7d112575/out/host_debug_unopt/../../../../../build/flutter-engine-source-c9b9d5780da342eb3f0f5e439a7db06f7d112575-x86_64-linux-x86_64-linux/src/flutter/third_party/libcxx/include/__functional/function.h:512:16
    #18 0x7ffff0ef4cc7 in std::_fl::function<std::_fl::unique_ptr<flutter::EmbedderRenderTarget, std::_fl::default_delete<flutter::EmbedderRenderTarget>> (SkISize const&)>::operator()(SkISize const&) const /nix/store/z4psshvfg8dvsnsn4jlyh3ib4f6nn0ch-flutter-engine-debug-unopt-c9b9d5780da342eb3f0f5e439a7db06f7d112575/out/host_debug_unopt/../../../../../build/flutter-engine-source-c9b9d5780da342eb3f0f5e439a7db06f7d112575-x86_64-linux-x86_64-linux/src/flutter/third_party/libcxx/include/__functional/function.h:1187:12
    #19 0x7ffff0eebeaf in flutter::(anonymous namespace)::LayerBuilder::PrepareBackingStore(std::_fl::function<std::_fl::unique_ptr<flutter::EmbedderRenderTarget, std::_fl::default_delete<flutter::EmbedderRenderTarget>> (SkISize const&)> const&) /nix/store/z4psshvfg8dvsnsn4jlyh3ib4f6nn0ch-flutter-engine-debug-unopt-c9b9d5780da342eb3f0f5e439a7db06f7d112575/out/host_debug_unopt/../../../../../build/flutter-engine-source-c9b9d5780da342eb3f0f5e439a7db06f7d112575-x86_64-linux-x86_64-linux/src/flutter/shell/platform/embedder/embedder_external_view_embedder.cc:320:31
    #20 0x7ffff0eeb9e3 in flutter::EmbedderExternalViewEmbedder::SubmitFlutterView(long, GrDirectContext*, std::_fl::shared_ptr<impeller::AiksContext> const&, std::_fl::unique_ptr<flutter::SurfaceFrame, std::_fl::default_delete<flutter::SurfaceFrame>>) /nix/store/z4psshvfg8dvsnsn4jlyh3ib4f6nn0ch-flutter-engine-debug-unopt-c9b9d5780da342eb3f0f5e439a7db06f7d112575/out/host_debug_unopt/../../../../../build/flutter-engine-source-c9b9d5780da342eb3f0f5e439a7db06f7d112575-x86_64-linux-x86_64-linux/src/flutter/shell/platform/embedder/embedder_external_view_embedder.cc:441:11
    #21 0x7ffff2a52644 in flutter::Rasterizer::DrawToSurfaceUnsafe(long, flutter::LayerTree&, float, std::_fl::optional<fml::TimePoint>) /nix/store/z4psshvfg8dvsnsn4jlyh3ib4f6nn0ch-flutter-engine-debug-unopt-c9b9d5780da342eb3f0f5e439a7db06f7d112575/out/host_debug_unopt/../../../../../build/flutter-engine-source-c9b9d5780da342eb3f0f5e439a7db06f7d112575-x86_64-linux-x86_64-linux/src/flutter/shell/common/rasterizer.cc:793:32
    #22 0x7ffff2a519eb in flutter::Rasterizer::DrawToSurfacesUnsafe(flutter::FrameTimingsRecorder&, std::_fl::vector<std::_fl::unique_ptr<flutter::LayerTreeTask, std::_fl::default_delete<flutter::LayerTreeTask>>, std::_fl::allocator<std::_fl::unique_ptr<flutter::LayerTreeTask, std::_fl::default_delete<flutter::LayerTreeTask>>>>) /nix/store/z4psshvfg8dvsnsn4jlyh3ib4f6nn0ch-flutter-engine-debug-unopt-c9b9d5780da342eb3f0f5e439a7db06f7d112575/out/host_debug_unopt/../../../../../build/flutter-engine-source-c9b9d5780da342eb3f0f5e439a7db06f7d112575-x86_64-linux-x86_64-linux/src/flutter/shell/common/rasterizer.cc:658:32
    #23 0x7ffff2a4f7c9 in flutter::Rasterizer::DrawToSurfaces(flutter::FrameTimingsRecorder&, std::_fl::vector<std::_fl::unique_ptr<flutter::LayerTreeTask, std::_fl::default_delete<flutter::LayerTreeTask>>, std::_fl::allocator<std::_fl::unique_ptr<flutter::LayerTreeTask, std::_fl::default_delete<flutter::LayerTreeTask>>>>) /nix/store/z4psshvfg8dvsnsn4jlyh3ib4f6nn0ch-flutter-engine-debug-unopt-c9b9d5780da342eb3f0f5e439a7db06f7d112575/out/host_debug_unopt/../../../../../build/flutter-engine-source-c9b9d5780da342eb3f0f5e439a7db06f7d112575-x86_64-linux-x86_64-linux/src/flutter/shell/common/rasterizer.cc:587:9
    #24 0x7ffff2a50a35 in flutter::Rasterizer::DoDraw(std::_fl::unique_ptr<flutter::FrameTimingsRecorder, std::_fl::default_delete<flutter::FrameTimingsRecorder>>, std::_fl::vector<std::_fl::unique_ptr<flutter::LayerTreeTask, std::_fl::default_delete<flutter::LayerTreeTask>>, std::_fl::allocator<std::_fl::unique_ptr<flutter::LayerTreeTask, std::_fl::default_delete<flutter::LayerTreeTask>>>>) /nix/store/z4psshvfg8dvsnsn4jlyh3ib4f6nn0ch-flutter-engine-debug-unopt-c9b9d5780da342eb3f0f5e439a7db06f7d112575/out/host_debug_unopt/../../../../../build/flutter-engine-source-c9b9d5780da342eb3f0f5e439a7db06f7d112575-x86_64-linux-x86_64-linux/src/flutter/shell/common/rasterizer.cc:491:7
    #25 0x7ffff2a589ed in flutter::Rasterizer::Draw(std::_fl::shared_ptr<flutter::Pipeline<flutter::FrameItem>> const&)::$_0::operator()(std::_fl::unique_ptr<flutter::FrameItem, std::_fl::default_delete<flutter::FrameItem>>) const /nix/store/z4psshvfg8dvsnsn4jlyh3ib4f6nn0ch-flutter-engine-debug-unopt-c9b9d5780da342eb3f0f5e439a7db06f7d112575/out/host_debug_unopt/../../../../../build/flutter-engine-source-c9b9d5780da342eb3f0f5e439a7db06f7d112575-x86_64-linux-x86_64-linux/src/flutter/shell/common/rasterizer.cc:259:19
    #26 0x7ffff2a58961 in decltype(std::declval<flutter::Rasterizer::Draw(std::_fl::shared_ptr<flutter::Pipeline<flutter::FrameItem>> const&)::$_0&>()(std::declval<std::_fl::unique_ptr<flutter::FrameItem, std::_fl::default_delete<flutter::FrameItem>>>())) std::_fl::__invoke[abi:v15000]<flutter::Rasterizer::Draw(std::_fl::shared_ptr<flutter::Pipeline<flutter::FrameItem>> const&)::$_0&, std::_fl::unique_ptr<flutter::FrameItem, std::_fl::default_delete<flutter::FrameItem>>>(flutter::Rasterizer::Draw(std::_fl::shared_ptr<flutter::Pipeline<flutter::FrameItem>> const&)::$_0&, std::_fl::unique_ptr<flutter::FrameItem, std::_fl::default_delete<flutter::FrameItem>>&&) /nix/store/z4psshvfg8dvsnsn4jlyh3ib4f6nn0ch-flutter-engine-debug-unopt-c9b9d5780da342eb3f0f5e439a7db06f7d112575/out/host_debug_unopt/../../../../../build/flutter-engine-source-c9b9d5780da342eb3f0f5e439a7db06f7d112575-x86_64-linux-x86_64-linux/src/flutter/third_party/libcxx/include/__functional/invoke.h:403:23
    #27 0x7ffff2a588fc in void std::_fl::__invoke_void_return_wrapper<void, true>::__call<flutter::Rasterizer::Draw(std::_fl::shared_ptr<flutter::Pipeline<flutter::FrameItem>> const&)::$_0&, std::_fl::unique_ptr<flutter::FrameItem, std::_fl::default_delete<flutter::FrameItem>>>(flutter::Rasterizer::Draw(std::_fl::shared_ptr<flutter::Pipeline<flutter::FrameItem>> const&)::$_0&, std::_fl::unique_ptr<flutter::FrameItem, std::_fl::default_delete<flutter::FrameItem>>&&) /nix/store/z4psshvfg8dvsnsn4jlyh3ib4f6nn0ch-flutter-engine-debug-unopt-c9b9d5780da342eb3f0f5e439a7db06f7d112575/out/host_debug_unopt/../../../../../build/flutter-engine-source-c9b9d5780da342eb3f0f5e439a7db06f7d112575-x86_64-linux-x86_64-linux/src/flutter/third_party/libcxx/include/__functional/invoke.h:488:9
    #28 0x7ffff2a588c4 in std::_fl::__function::__alloc_func<flutter::Rasterizer::Draw(std::_fl::shared_ptr<flutter::Pipeline<flutter::FrameItem>> const&)::$_0, std::_fl::allocator<flutter::Rasterizer::Draw(std::_fl::shared_ptr<flutter::Pipeline<flutter::FrameItem>> const&)::$_0>, void (std::_fl::unique_ptr<flutter::FrameItem, std::_fl::default_delete<flutter::FrameItem>>)>::operator()[abi:v15000](std::_fl::unique_ptr<flutter::FrameItem, std::_fl::default_delete<flutter::FrameItem>>&&) /nix/store/z4psshvfg8dvsnsn4jlyh3ib4f6nn0ch-flutter-engine-debug-unopt-c9b9d5780da342eb3f0f5e439a7db06f7d112575/out/host_debug_unopt/../../../../../build/flutter-engine-source-c9b9d5780da342eb3f0f5e439a7db06f7d112575-x86_64-linux-x86_64-linux/src/flutter/third_party/libcxx/include/__functional/function.h:185:16
    #29 0x7ffff2a57c50 in std::_fl::__function::__func<flutter::Rasterizer::Draw(std::_fl::shared_ptr<flutter::Pipeline<flutter::FrameItem>> const&)::$_0, std::_fl::allocator<flutter::Rasterizer::Draw(std::_fl::shared_ptr<flutter::Pipeline<flutter::FrameItem>> const&)::$_0>, void (std::_fl::unique_ptr<flutter::FrameItem, std::_fl::default_delete<flutter::FrameItem>>)>::operator()(std::_fl::unique_ptr<flutter::FrameItem, std::_fl::default_delete<flutter::FrameItem>>&&) /nix/store/z4psshvfg8dvsnsn4jlyh3ib4f6nn0ch-flutter-engine-debug-unopt-c9b9d5780da342eb3f0f5e439a7db06f7d112575/out/host_debug_unopt/../../../../../build/flutter-engine-source-c9b9d5780da342eb3f0f5e439a7db06f7d112575-x86_64-linux-x86_64-linux/src/flutter/third_party/libcxx/include/__functional/function.h:359:12

SUMMARY: LeakSanitizer: 16 byte(s) leaked in 1 allocation(s).
```

</details>


### Flutter Doctor output

<details open><summary>Doctor output</summary>

```console
[ +319 ms] Unable to locate an Android SDK.
[  +61 ms] Local engine source at /nix/store/85wqywgs5q16zl34pnfkyaf1w9hgrq14-flutter-engine-c9b9d5780da342eb3f0f5e439a7db06f7d112575
[   +4 ms]   ╔════════════════════════════════════════════════════════════════════════════╗
             ║                 Welcome to Flutter! - https://flutter.dev                  ║
             ║                                                                            ║
             ║ The Flutter tool uses Google Analytics to anonymously report feature usage ║
             ║ statistics and basic crash reports. This data is used to help improve      ║
             ║ Flutter tools over time.                                                   ║
             ║                                                                            ║
             ║ Flutter tool analytics are not sent on the very first run. To disable      ║
             ║ reporting, type 'flutter config --no-analytics'. To display the current    ║
             ║ setting, type 'flutter config'. If you opt out of analytics, an opt-out    ║
             ║ event will be sent, and then no further information will be sent by the    ║
             ║ Flutter tool.                                                              ║
             ║                                                                            ║
             ║ By downloading the Flutter SDK, you agree to the Google Terms of Service.  ║
             ║ The Google Privacy Policy describes how data is handled in this service.   ║
             ║                                                                            ║
             ║ Moreover, Flutter includes the Dart SDK, which may send usage metrics and  ║
             ║ crash reports to Google.                                                   ║
             ║                                                                            ║
             ║ Read about data we send with crash reports:                                ║
             ║ https://flutter.dev/to/crash-reporting                                     ║
             ║                                                                            ║
             ║ See Google's privacy policy:                                               ║
             ║ https://policies.google.com/privacy                                        ║
             ║                                                                            ║
             ║ To disable animations in this tool, use                                    ║
             ║ 'flutter config --no-cli-animations'.                                      ║
             ╚════════════════════════════════════════════════════════════════════════════╝
           
[  +55 ms] executing: [/nix/store/iqnsvd5gs7394zjbq7ll8ks7gzv8zbqz-flutter-wrapped-3.24.1-sdk-links/] git -c log.showSignature=false log -n 1 --pretty=format:%ar
[   +7 ms] Exit code 128 from: git -c log.showSignature=false log -n 1 --pretty=format:%ar
[        ] fatal: detected dubious ownership in repository at '/nix/store/iqnsvd5gs7394zjbq7ll8ks7gzv8zbqz-flutter-wrapped-3.24.1-sdk-links'
           To add an exception for this directory, call:

                git config --global --add safe.directory /nix/store/iqnsvd5gs7394zjbq7ll8ks7gzv8zbqz-flutter-wrapped-3.24.1-sdk-links
[  +68 ms] [✓] Flutter (Channel stable, 3.24.1, on NixOS 24.11 (Vicuna) 6.6.52, locale en_US.UTF-8)
[        ]     • Flutter version 3.24.1 on channel stable at /nix/store/iqnsvd5gs7394zjbq7ll8ks7gzv8zbqz-flutter-wrapped-3.24.1-sdk-links
[        ]     • Upstream repository https://github.com/flutter/flutter.git
[        ]     • Framework revision nixpkgs000 (), 1970-01-01 00:00:00
[        ]     • Engine revision c9b9d5780d
[        ]     • Dart version 3.5.1
[        ]     • DevTools version 2.37.0
[   +2 ms] [✗] Android toolchain - develop for Android devices
[        ]     ✗ Unable to locate Android SDK.
[        ]       Install Android Studio from: https://developer.android.com/studio/index.html
[        ]       On first launch it will assist you in installing the Android SDK components.
[        ]       (or visit https://flutter.dev/to/linux-android-setup for detailed instructions).
[        ]       If the Android SDK has been installed to a custom location, please use
[        ]       `flutter config --android-sdk` to update to that location.
[        ] [✗] Chrome - develop for the web (Cannot find Chrome executable at google-chrome)
[        ]     ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[ +493 ms] [✗] Linux toolchain - develop for Linux desktop
[        ]     ✗ clang++ is required for Linux development.
[        ]       It is likely available from your distribution (e.g.: apt install clang), or can be downloaded from https://releases.llvm.org/
[        ]     ✗ CMake is required for Linux development.
[        ]       It is likely available from your distribution (e.g.: apt install cmake), or can be downloaded from https://cmake.org/download/
[        ]     ✗ ninja is required for Linux development.
[        ]       It is likely available from your distribution (e.g.: apt install ninja-build), or can be downloaded from https://github.com/ninja-build/ninja/releases
[        ]     • pkg-config version 0.29.2
[        ]     ✗ GTK 3.0 development libraries are required for Linux development.
[        ]       They are likely available from your distribution (e.g.: apt install libgtk-3-dev)
[   +1 ms] [!] Android Studio (not installed)
[        ]     • Android Studio not found; download from https://developer.android.com/studio/index.html
[        ]       (or visit https://flutter.dev/to/linux-android-setup for detailed instructions).
[        ] [✓] Connected device (1 available)
[        ]     • Linux (desktop) • linux • linux-x64 • NixOS 24.11 (Vicuna) 6.6.52
[        ] [✓] Network resources
[        ]     • All expected network resources are available.
[        ] ! Doctor found issues in 4 categories.
[  +15 ms] "flutter doctor" took 636ms.
[   +3 ms] The Flutter CLI developer tool uses Google Analytics to report usage and diagnostic
           data along with package dependencies, and crash reporting to send basic crash
           reports. This data is used to help improve the Dart platform, Flutter framework,
           and related tools.
           
           Telemetry is not sent on the very first run. To disable reporting of telemetry,
           run this terminal command:
           
               flutter --disable-analytics
           
           If you opt out of telemetry, an opt-out event will be sent, and then no further
           information will be sent. This data is collected in accordance with the Google
           Privacy Policy (https://policies.google.com/privacy).
           
[  +15 ms] ensureAnalyticsSent: 0ms
[        ] Running 1 shutdown hook
[   +1 ms] Shutdown hooks complete
[   +2 ms] exiting with code 0

```

</details>