fix: resolve severe memory leak by disposing controllers in DocumentU…#1062
fix: resolve severe memory leak by disposing controllers in DocumentU…#1062vibhutomer wants to merge 1 commit into
Conversation
…ploadControl Signed-off-by: vibhutomer <vibhutomer25@gmail.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThe ChangesMemory Leak Fix for Document Upload Controllers
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Description
This PR resolves a critical memory leak within the document upload workflow that could lead to Out-of-Memory (OOM) application crashes during long operator sessions.
Previously,
_DocumentUploadControlStateinstantiated aTextEditingControllerand aFixedExtentScrollControllerbut failed to implement adispose()method. This caused "ghost" controllers to remain active in memory every time the widget was destroyed, compounding RAM usage over multiple registrations until the OS killed the process.Changes Made
@override void dispose()lifecycle method indocument_upload_control.dart..dispose()ondocumentControllerandscrollControllerto release native memory bindings.Related Issue
Closes #1061
Type of Change
Checklist
Summary by CodeRabbit