Skip to content

Commit 687edeb

Browse files
authored
Add FlutterDesktopViewDestroy (#310)
* The engine owned by the view will also be shut down implicitly. Signed-off-by: Boram Bae <[email protected]>
1 parent 45cc5b5 commit 687edeb

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

shell/platform/tizen/flutter_tizen.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,11 @@ void FlutterDesktopEngineNotifyAppIsDetached(FlutterDesktopEngineRef engine) {
181181
EngineFromHandle(engine)->lifecycle_channel()->AppIsDetached();
182182
}
183183

184+
void FlutterDesktopViewDestroy(FlutterDesktopViewRef view_ref) {
185+
flutter::FlutterTizenView* view = ViewFromHandle(view_ref);
186+
delete view;
187+
}
188+
184189
void FlutterDesktopViewResize(FlutterDesktopViewRef view,
185190
int32_t width,
186191
int32_t height) {

shell/platform/tizen/public/flutter_tizen.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,14 +152,20 @@ FLUTTER_EXPORT FlutterDesktopViewRef FlutterDesktopViewCreateFromElmParent(
152152
FlutterDesktopEngineRef engine,
153153
void* parent);
154154

155+
// Destroys the view.
156+
//
157+
// The engine owned by the view will also be shut down implicitly.
158+
// @warning This API is a work-in-progress and may change.
159+
FLUTTER_EXPORT void FlutterDesktopViewDestroy(FlutterDesktopViewRef view);
160+
155161
// Returns a handle to evas object that the FlutterView is drawn to.
156162
//
157163
// Cast the returned void* to Evas_Object*.
158164
// @warning This API is a work-in-progress and may change.
159165
FLUTTER_EXPORT void* FlutterDesktopViewGetEvasObject(
160166
FlutterDesktopViewRef view);
161167

162-
// Resize the FlutterView.
168+
// Resizes the view.
163169
// @warning This API is a work-in-progress and may change.
164170
FLUTTER_EXPORT void FlutterDesktopViewResize(FlutterDesktopViewRef view,
165171
int32_t width,

0 commit comments

Comments
 (0)