Skip to content

Conversation

@JSUYA
Copy link
Member

@JSUYA JSUYA commented Jun 21, 2022

When ElmFlutterView is deleted, view_ is no longer used, so destory it.

}

evas_object_event_callback_add(
evas_object_, EVAS_CALLBACK_DEL,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When does the object get deleted? By who?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

evas_object_ is deleted when parent_ is deleted.
This deletion is process by Eo of EFL. (ElmFlutterView always needs a valid evas object (parent).)
Of course, if the user deletes FlutterView, I think that another engine problem(crash?) may occur.
I am considering several cases.

@JSUYA JSUYA force-pushed the dev/elmflutterview_shutdown branch from b48f36a to 7e8769b Compare June 24, 2022 06:22
@bbrto21
Copy link
Contributor

bbrto21 commented Jun 29, 2022

Q. If the container created inside the view is deleted by some factor of outside, and the view know that event through the callback, should the state of the view be considered valid?

+) Should view_ also be deleted and indicate that this view is no longer valid?

@JSUYA JSUYA force-pushed the dev/elmflutterview_shutdown branch from 7e8769b to 4eadf71 Compare July 1, 2022 05:16
@JSUYA JSUYA force-pushed the dev/elmflutterview_shutdown branch 3 times, most recently from c3f7e84 to b68d257 Compare July 1, 2022 06:57
@bbrto21
Copy link
Contributor

bbrto21 commented Jul 11, 2022

I opened a PR to add an API that destroys the view. @JSUYA why don't you apply that in this PR?

[](void *data, Evas *evas, Evas_Object *object, void *event_info) {
auto engine = reinterpret_cast<FlutterDesktopEngineRef>(data);
if (engine) {
FlutterDesktopEngineShutdown(engine);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be updated based on flutter-tizen/engine#310.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed it to add view_ destroy call to the destructor.

When ElmFlutterView is deleted, view_ is no longer used, so destory it.
@JSUYA JSUYA force-pushed the dev/elmflutterview_shutdown branch from b68d257 to 3d9d671 Compare July 14, 2022 09:31
@JSUYA JSUYA changed the title ElmFlutterView: Do EngineShutdown when evas_object deleted ElmFlutterView: Destory view instance Jul 14, 2022
@bbrto21 bbrto21 merged commit 592bb17 into flutter-tizen:master Jul 15, 2022
@swift-kim
Copy link
Member

@bbrto21 @JSUYA This PR is causing a native app build failure. Please either revert this PR or update the engine hash right away.

@bbrto21
Copy link
Contributor

bbrto21 commented Jul 18, 2022

@swift-kim I'm so sorry, I added a commit for updating engine hash to #398
@swift-kim I'll open PR to update engine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants