flutter-code-editor icon indicating copy to clipboard operation
flutter-code-editor copied to clipboard

[BUG] missing !mounted/disposed checks

Open quaaantumdev opened this issue 6 months ago • 0 comments

The library uses WidgetsBinding.instance.addPostFrameCallback and uses the context in the callback without checking if the state is actually still mounted. This may not cause issues most of the time – but the time will come – and it did for me 🙈

Same thing with the CodeController, it has an async gap in rebuild() before accessing the context but it does not check if the controller has been disposed in the meantime. another 💣

Here is a pull request that fixes both of these: https://github.com/akvelon/flutter-code-editor/pull/298

Thanks for the package! 🙏

quaaantumdev avatar Apr 27 '25 22:04 quaaantumdev