-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error when switching to homescreen during capture #11
Comments
Interesting bug! Thanks for opening the issue. This is quite a difficult problem, as RAM images might be deleted when other applications also require RAM. Rather than pausing stopping the capturing process seems to be more appropriate. But even then, the written images are still in the RAM and converting & processing might take a while. During this time the user might open other applications or occupy RAM in another way (and I think ios even forbids heavy RAM usage during closed applications). I still tend to the second option. What do you think? I cannot imagine a workaround so far, except to manually check for this error with a |
I guess the 2nd sounds good (breaking / aborting the capture). |
I was actually not able to reproduce the error as a raised exception. For me, it only printed it in the console, and it might still do that. Nonetheless, I release a new release (1e9859b or render: ^0.1.2) where a fatal error arises when closing the application during an active render session. You can now check for errors yourself, such as this one, and show a message to the user (Everything else would exceed the function spectrum of this plugin). |
Repro steps:
VS code halts execution and inspects the file dart:ui/painting.dart, pointing to line 1891 (using Flutter 3.7.8). I'm also wrapping the content of the method "motionRenderCallback" in a try catch block.
|
Sorry for not seeing the update! I am currently too tight with other projects (unpredictable duration :( ). As far as i can remember this issue was difficult for me to resolve, as I didn't get the error, only the console message. I will have to do a bigger deep dive, the next time! Weird, I thought the update must have resolved to switch screens. Don't hesitate to debug by yourself, this might be faster, especially as you have the correct error path! |
Yes, I understand, no problem. The issue is also a bit inconsistent, I'm working on MacOS for iOS development so that might affect things as well. Thanks in advance! |
When switching to the home screen while using captureMotionWithStream() an exception is thrown:
[VERBOSE-2:dart_vm_initializer.cc(41)] Unhandled Exception: Null check operator used on a null value #0 _Image.toByteData.<anonymous closure>.<anonymous closure> (dart:ui/painting.dart:1891:25)
Expected behavior: The rendering / capture process should be paused?
The exception refers to line 1891 of painting.dart
Any ideas or workarounds on how to avoid this would be great!
Thanks a lot.
The text was updated successfully, but these errors were encountered: