Skip to content

Commit a938f2b

Browse files
authored
Ensure FlutterDesktopViewControllerState declares default destructor (#428)
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<flutter::FlutterELinuxView>::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 <lukeh@padl.com>
1 parent 9d0ff07 commit a938f2b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/flutter/shell/platform/linux_embedded/flutter_elinux_state.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ struct FlutterELinuxView;
3434
struct FlutterDesktopViewControllerState {
3535
// The view that backs this state object.
3636
std::unique_ptr<flutter::FlutterELinuxView> view;
37+
38+
~FlutterDesktopViewControllerState() = default;
3739
};
3840

3941
// Wrapper to distinguish the plugin registrar ref from the engine ref given out

0 commit comments

Comments
 (0)