Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix disappearing aircraft when deleting packages.
There are a few different code paths for deleting packages depending on the state of the package, and two of them were deleting items from a list they were iterating over without first making a copy, causing each iteration of the loop to skip over a flight, making it still used since the flight was never deleted, but unreachable since the package that owned it was deleted. This only happened when the package was canceled in its draft state (the user clicked the X without ever saving the package), or if the user canceled a package mid fast forward (the controls for which aren't even visible to users) while only a portion of the package was active. In both cases, only even numbered flights were lost. There's a better fix lurking in here somewhere but the interaction with the Qt model complicates it. Fortunately that mess would be cleaned up automatically by moving this dialog into React, which we'll do some day. Fixes #3257. Fixes #3258.