[Bug]: Crash during hand tool movements
What happened?
When moving around the canvas with v2.3.0-beta.4 on Android, the app will frequently crash.
Steps to reproduce: ⚠️ Warning: Reproducing this on an Android emulator on my PC caused my entire PC to crash!
- Open a document
- Select the hand tool
- Perform many movements very quickly
https://github.com/user-attachments/assets/ade17563-9338-4067-81ee-c37bb4a3b1c0
This is just the fastest way to trigger the crash. When working normally, the crash becomes easier to trigger over time, and eventually it will be triggered by a single move or scale. This makes me feel like it might be related to a memory leak.
I found that short-circuiting this function (inserting a return at line 653) prevents the crash, so I believe the crash is related to baking or something that happens as a result of baking.
https://github.com/LinwoodDev/Butterfly/blob/98178a9261b3d5fdae68d3ec80e7c5e229970534/app/lib/cubits/current_index.dart#L648
Version
v2.3.0-beta.4
Platform
Android
Relevant log output
Both flutter and adb logcat don't seem to produce any logs about the crash :(
Code of Conduct
- [x] I agree to follow this project's Code of Conduct
Hmm thats not good, if you found a solution feel free to create a pr. If you are struggeling, feel free to answer and i will try to find the cause
Bug confirmed, I found the fix that fixed it on the develop branch but I don't know if this really fixes the problem in the released 2.4.0-beta.4 because i just changed it to the previous behavior.
Bake isn't run everytime now, but we need to see if this really fixes the problem
Thank you for fixing that! That returned develop to the beta 4 behavior, so I was still able to reproduce the crash on rc0, but it was definitely better than on develop previously.
I think I've found a way to make the issue disappear completely, so I'll be opening a PR shortly!