Skip to content

Commit

Permalink
Cleanup when destroying view and engine (#304)
Browse files Browse the repository at this point in the history
* 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 <boram21.bae@samsung.com>
  • Loading branch information
bbrto21 authored Jun 29, 2022
1 parent 7aa7aa2 commit f9b374c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion shell/platform/tizen/flutter_tizen_engine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ FlutterTizenEngine::FlutterTizenEngine(const FlutterProjectBundle& project)
}

FlutterTizenEngine::~FlutterTizenEngine() {
renderer_ = nullptr;
StopEngine();
}

bool FlutterTizenEngine::RunEngine() {
Expand Down
4 changes: 3 additions & 1 deletion shell/platform/tizen/flutter_tizen_view.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ FlutterTizenView::FlutterTizenView(std::unique_ptr<TizenViewBase> tizen_view)
}
}

FlutterTizenView::~FlutterTizenView() {}
FlutterTizenView::~FlutterTizenView() {
DestroyRenderSurface();
}

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

0 comments on commit f9b374c

Please sign in to comment.