Skip to content

Commit

Permalink
Add FlutterDesktopViewDestroy (#310)
Browse files Browse the repository at this point in the history
* The engine owned by the view will also be shut down implicitly.

Signed-off-by: Boram Bae <[email protected]>
  • Loading branch information
bbrto21 authored Jul 12, 2022
1 parent 45cc5b5 commit 687edeb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions shell/platform/tizen/flutter_tizen.cc
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,11 @@ void FlutterDesktopEngineNotifyAppIsDetached(FlutterDesktopEngineRef engine) {
EngineFromHandle(engine)->lifecycle_channel()->AppIsDetached();
}

void FlutterDesktopViewDestroy(FlutterDesktopViewRef view_ref) {
flutter::FlutterTizenView* view = ViewFromHandle(view_ref);
delete view;
}

void FlutterDesktopViewResize(FlutterDesktopViewRef view,
int32_t width,
int32_t height) {
Expand Down
8 changes: 7 additions & 1 deletion shell/platform/tizen/public/flutter_tizen.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,20 @@ FLUTTER_EXPORT FlutterDesktopViewRef FlutterDesktopViewCreateFromElmParent(
FlutterDesktopEngineRef engine,
void* parent);

// Destroys the view.
//
// The engine owned by the view will also be shut down implicitly.
// @warning This API is a work-in-progress and may change.
FLUTTER_EXPORT void FlutterDesktopViewDestroy(FlutterDesktopViewRef view);

// Returns a handle to evas object that the FlutterView is drawn to.
//
// Cast the returned void* to Evas_Object*.
// @warning This API is a work-in-progress and may change.
FLUTTER_EXPORT void* FlutterDesktopViewGetEvasObject(
FlutterDesktopViewRef view);

// Resize the FlutterView.
// Resizes the view.
// @warning This API is a work-in-progress and may change.
FLUTTER_EXPORT void FlutterDesktopViewResize(FlutterDesktopViewRef view,
int32_t width,
Expand Down

0 comments on commit 687edeb

Please sign in to comment.