From e85e55bb4ff81275f752fbaffa804c51c8e91a30 Mon Sep 17 00:00:00 2001 From: Luke Howard Date: Wed, 30 Oct 2024 15:30:27 +1100 Subject: [PATCH] Ensure FlutterDesktopViewControllerState declares default destructor types containing std::unique_ptr to incomplete types require a destructor to be defined as the size is unavailable, otherwise the following error is raised at compile time: /usr/lib/gcc/aarch64-linux-gnu/13/../../../../include/c++/13/bits/unique_ptr.h:97:16: error: invalid application of 'sizeof' to an incomplete type 'flutter::FlutterELinuxView' 91 | _GLIBCXX23_CONSTEXPR 92 | void 93 | operator()(_Tp* __ptr) const | `- note: in instantiation of member function 'std::default_delete::operator()' requested here 94 | { 95 | static_assert(!is_void<_Tp>::value, 96 | "can't delete pointer to incomplete type"); 97 | static_assert(sizeof(_Tp)>0, | `- error: invalid application of 'sizeof' to an incomplete type 'flutter::FlutterELinuxView' 98 | "can't delete pointer to incomplete type"); 99 | delete __ptr; Signed-off-by: Luke Howard --- .../shell/platform/linux_embedded/flutter_elinux_state.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/flutter/shell/platform/linux_embedded/flutter_elinux_state.h b/src/flutter/shell/platform/linux_embedded/flutter_elinux_state.h index 8248f7e8..aea43c4c 100644 --- a/src/flutter/shell/platform/linux_embedded/flutter_elinux_state.h +++ b/src/flutter/shell/platform/linux_embedded/flutter_elinux_state.h @@ -34,6 +34,8 @@ struct FlutterELinuxView; struct FlutterDesktopViewControllerState { // The view that backs this state object. std::unique_ptr view; + + ~FlutterDesktopViewControllerState() = default; }; // Wrapper to distinguish the plugin registrar ref from the engine ref given out