Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed|libdeng2: Crash when recreating canvas
When the audiences of the old canvas were copied to the new one, the C++ default assignment operator was used. This meant a pointer to the old audiences was copied, causing a crash when continuing iteration through a deleted audience. Todo for later: This could use further improvement, perhaps by utilizing a QSet in Observers<>. If the observers set is destroyed in the middle of iterating through a large number of observers, there will likely still be a crash because the 'next' iterator of the loop will become invalid (and not just point to the end of the set as in this instance when there is a single observer). Observers<>::Loop could also observe the set itself, although in that case it would be necessary to derive a custom set class that provides the necessary notifications to Loop.
- Loading branch information
Showing
2 changed files
with
30 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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