fix: suppress deprecated coroutine warning to restore Windows build#3373
Closed
prajakta128 wants to merge 2 commits into
Closed
fix: suppress deprecated coroutine warning to restore Windows build#3373prajakta128 wants to merge 2 commits into
prajakta128 wants to merge 2 commits into
Conversation
UsbSerial.usbEventStream?.listen() and Connectivity() .onConnectivityChanged.listen() were called without storing the returned StreamSubscription objects, so they could never be cancelled. This causes a memory leak on every hot-restart or re-initialization as subscriptions accumulate. Fix: store both subscriptions in _usbSubscription and _connectivitySubscription fields, and cancel them in dispose().
The latest Visual Studio removed support for experimental C++ features (/await compiler option, <experimental/coroutine>), causing the Windows Flutter build to fail with error STL1011. Adding _SILENCE_EXPERIMENTAL_COROUTINE_DEPRECATION_WARNINGS to the existing add_definitions call suppresses the error so Windows builds work again while a permanent upstream fix is awaited in the permission_handler_windows plugin. Fixes fossasia#3246
Contributor
There was a problem hiding this comment.
Sorry @prajakta128, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
Contributor
Author
|
Hi @marcnause, I noticed this issue was already resolved in #3279 — apologies for the duplicate PR, I will make sure to check for existing fixes before submitting next time. Feel free to close #3373. |
Contributor
|
Thank you for checking and thank you for your contribution anyway. 👍 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3246
Problem
The Windows Flutter build fails on the latest Visual Studio because the
/awaitcompiler option and<experimental/coroutine>are deprecated by Microsoft and removed in MSVC 14.51+. This breaks the entire Windows CI pipeline and prevents any contributor from building the app on Windows locally.Root Cause
The
permission_handler_windowsplugin still references<experimental/coroutine>which Visual Studio 18 (MSVC 14.51+) no longer supports. The new standard is C++20<coroutine>.Fix
Added
-D_SILENCE_EXPERIMENTAL_COROUTINE_DEPRECATION_WARNINGSto the existingadd_definitionsline inwindows/CMakeLists.txt. This is the recommended interim fix per flutter/flutter#186452 untilpermission_handler_windowsmigrates to C++20 upstream.Impact
permission_handler_windowsis updated upstreamScreenshots / Recordings
N/A — build fix, no UI changes
Checklist
constants.dartor localization files instead of hard-coded values.dart formator the IDE formatter.flutter analyzeand tests run influtter test.