Skip to content

Commit f9b374c

Browse files
authored
Cleanup when destroying view and engine (#304)
* The view should be responsible for the life cycle of the engine, and the engine should stop naturally when the view is destroyed. * There is no need to explicitly assign null to a unique pointer in the destructor of engine. Signed-off-by: Boram Bae <[email protected]>
1 parent 7aa7aa2 commit f9b374c

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

shell/platform/tizen/flutter_tizen_engine.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ FlutterTizenEngine::FlutterTizenEngine(const FlutterProjectBundle& project)
9191
}
9292

9393
FlutterTizenEngine::~FlutterTizenEngine() {
94-
renderer_ = nullptr;
94+
StopEngine();
9595
}
9696

9797
bool FlutterTizenEngine::RunEngine() {

shell/platform/tizen/flutter_tizen_view.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ FlutterTizenView::FlutterTizenView(std::unique_ptr<TizenViewBase> tizen_view)
5353
}
5454
}
5555

56-
FlutterTizenView::~FlutterTizenView() {}
56+
FlutterTizenView::~FlutterTizenView() {
57+
DestroyRenderSurface();
58+
}
5759

5860
void FlutterTizenView::SetEngine(std::unique_ptr<FlutterTizenEngine> engine) {
5961
engine_ = std::move(engine);

0 commit comments

Comments
 (0)