Skip to content

Commit

Permalink
[webview_flutter] Disable unnecessary web-engine initialization
Browse files Browse the repository at this point in the history
ewk_init() and ewk_shutdown() are designed to be called only once in a process.
(If ewk_init() is called after ewk_shutdown() is called, SIGTRAP is called internally.)
ewk_init() initializes the efl module and web engine's arguments data.
The efl module is initialized by default in OS, and Arguments data is also initialized
through SetArguments() API, so calling ewk_init() is not necessary.
Therefore, temporarily comment out ewk_init() and ewk_shutdown().
It can be reverted depending on updates to chromium-efl. ewk_init();
  • Loading branch information
JSUYA committed Jul 17, 2024
1 parent 0db29b4 commit a939962
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
4 changes: 4 additions & 0 deletions packages/webview_flutter/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## NEXT

* Disable unnecessary web-engine initialization.

## 0.9.3

* Prevent duplicate Dispose() calls.
Expand Down
12 changes: 10 additions & 2 deletions packages/webview_flutter/tizen/src/webview.cc
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ void WebView::Dispose() {
evas_object_del(webview_instance_);
}

ewk_shutdown();
// ewk_shutdown();
disposed_ = true;
}

Expand Down Expand Up @@ -306,7 +306,15 @@ bool WebView::InitWebView() {
EwkInternalApiBinding::GetInstance().main.SetArguments(chromium_argc,
chromium_argv);

ewk_init();
// TODO(jsuya): ewk_init() and ewk_shutdown() are designed to be called only
// once in a process.(If ewk_init() is called after ewk_shutdown() is called,
// SIGTRAP is called internally.) ewk_init() initializes the efl modules and
// web engine's arguments data. The efl modules are initialized by default in
// OS, and arguments data is also initialized through SetArguments() API, so
// calling ewk_init() is not necessary. Therefore, temporarily comment out
// ewk_init() and ewk_shutdown(). It can be reverted depending on updates to
// chromium-efl.
// ewk_init();
Ecore_Evas* evas = ecore_evas_new("wayland_egl", 0, 0, 1, 1, 0);

webview_instance_ = ewk_view_add(ecore_evas_get(evas));
Expand Down

0 comments on commit a939962

Please sign in to comment.