Skip to content

[flutter_inappwebview] Fix crash on webview dispose#1026

Merged
JSUYA merged 1 commit into
flutter-tizen:masterfrom
JSUYA:flutter_inappwebview_fix_dispose
Jun 1, 2026
Merged

[flutter_inappwebview] Fix crash on webview dispose#1026
JSUYA merged 1 commit into
flutter-tizen:masterfrom
JSUYA:flutter_inappwebview_fix_dispose

Conversation

@JSUYA
Copy link
Copy Markdown
Member

@JSUYA JSUYA commented Jun 1, 2026

If WebView releases the ecore_evas used per instance in Dispose(), the EGL display shared with the flutter-tizen renderer is turned off, causing a crash on the next frame.

Share a single Ecore_Evas across all WebViews and never release it.

@JSUYA JSUYA self-assigned this Jun 1, 2026
@JSUYA JSUYA added the bug Something isn't working label Jun 1, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the flutter_inappwebview_tizen package to version 0.1.1, modifying WebView to share a single static Ecore_Evas instance instead of creating and freeing one per webview. Feedback on the changes highlights that if the static Ecore_Evas initialization fails initially, it will remain nullptr for all subsequent webview creations. A suggestion is provided to lazily initialize the static pointer to handle potential initial failures robustly.

Comment thread packages/flutter_inappwebview/tizen/src/webview.cc Outdated
@JSUYA
Copy link
Copy Markdown
Member Author

JSUYA commented Jun 1, 2026

This PR resolves an issue occurring in the integration_test of flutter_inappwebview.

[E] tizen_renderer_egl.cc: PrintEGLError(332) > EGL error: EGL_NOT_INITIALIZED
[E] tizen_renderer_egl.cc: OnMakeCurrent(272) > Could not make the onscreen context current.
[E] [ERROR:flutter/shell/gpu/gpu_surface_gl_skia.cc(220)] Could not make the context current to acquire the frame.
[E] onSigabrt called

If WebView releases the ecore_evas used per instance in Dispose(),
the EGL display shared with the flutter-tizen renderer is turned off,
causing a crash on the next frame.

Share a single Ecore_Evas across all WebViews and never release it.
@JSUYA JSUYA force-pushed the flutter_inappwebview_fix_dispose branch from 156efc9 to b456799 Compare June 1, 2026 06:46
@seungsoo47
Copy link
Copy Markdown
Contributor

Do we need to apply this patch to the flutter_webview_tizen plugin?

@JSUYA
Copy link
Copy Markdown
Member Author

JSUYA commented Jun 1, 2026

Do we need to apply this patch to the flutter_webview_tizen plugin?

Yes I will make pr for flutter_webview_tizen/lwe.
I checked to make it the same way in flutter_webview_tizen/lwe, but the structure is slightly different from inappwebview. It might not be necessary.

@seungsoo47
Copy link
Copy Markdown
Contributor

Do we need to apply this patch to the flutter_webview_tizen plugin?

Yes I will make pr for flutter_webview_tizen/lwe. I checked to make it the same way in flutter_webview_tizen/lwe, but the structure is slightly different from inappwebview. It might not be necessary.

Thank you for the explanation.

@JSUYA JSUYA merged commit d6dbdbb into flutter-tizen:master Jun 1, 2026
6 checks passed
@JSUYA
Copy link
Copy Markdown
Member Author

JSUYA commented Jun 1, 2026

I confirmed that a crash occurs at evas_object_del(webview_instance_); when running integration_test on the TV emulator(I tested Tizen 10.0 TV Emulator).

✓ Built build/tizen/tpk/org.tizen.flutter_inappwebview_tizen_example-1.0.0.tpk (52.4MB)
Installing build/tizen/tpk/org.tizen.flutter_inappwebview_tizen_example-1.0.0.tpk...         5.4s
VMServiceFlutterDriver: Connecting to Flutter application at http://127.0.0.1:38299/aDDqvb2MRdw=/
VMServiceFlutterDriver: Isolate found with number: 6142057236792791
VMServiceFlutterDriver: Isolate 6142057236792791 is runnable.
VMServiceFlutterDriver: Isolate is paused at start.
VMServiceFlutterDriver: Attempting to resume isolate
[I] 00:00 +0: (setUpAll)
[I] 00:00 +1: load callbacks and navigation controls
VMServiceFlutterDriver: Connected to Flutter application.
[E] flutter_tizen_engine.cc: OnUpdateSemantics(478) > The accessibility bridge must be initialized.
[E] flutter_tizen_engine.cc: OnUpdateSemantics(478) > The accessibility bridge must be initialized.
[E] DotNET onSigsegv called on org.tizen.flutter_inappwebview_tizen_example / DN_izen_example(14759)
Unhandled exception:
DriverError: Failed to fulfill RequestData due to remote error
Original error: ext.flutter.driver: (112) Service has disappeared
Original stack trace:
#0      new _OutstandingRequest (package:vm_service/src/vm_service.dart:278:34)
#1      VmService._call.<anonymous closure> (package:vm_service/src/vm_service.dart:1960:25)
#2      VmService._call (package:vm_service/src/vm_service.dart:1972:8)
#3      VmService.callServiceExtension (package:vm_service/src/vm_service.dart:1911:14)
#4      VMServiceFlutterDriver.sendCommand (package:flutter_driver/src/driver/vmservice_driver.dart:327:12)
#5      FlutterDriver.requestData (package:flutter_driver/src/driver/driver.dart:573:13)
#6      integrationDriver (package:integration_test/integration_test_driver.dart:71:42)
<asynchronous suspension>


#0      VMServiceFlutterDriver.sendCommand (package:flutter_driver/src/driver/vmservice_driver.dart:340:7)
<asynchronous suspension>
#1      FlutterDriver.requestData (package:flutter_driver/src/driver/driver.dart:573:7)
<asynchronous suspension>
#2      integrationDriver (package:integration_test/integration_test_driver.dart:71:29)
<asynchronous suspension>

Additionally, I found that while the test appeared to run correctly in CI, the count was recorded as 0.
(However, since no crash occurred or 'fail' was printed, I think this is simply an aggregation issue.)

flutter_inappwebview example works correctly on the TV emulator, but further investigation is required to determine the exact reason.

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

Labels

bug Something isn't working p: flutter_inappwebview

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants