-
Notifications
You must be signed in to change notification settings - Fork 8.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add nullptr checks to shared_ptr conversions (#17199)
We use `if (auto self = weakSelf.get())` in a lot of places. That assigns the value to `self` and then checks if it's truthy. Sometimes we need to add a "is (app) closing" check because XAML, so we wrote something akin to `if (self = ...; !closing)`. But that's wrong because the correct `if (foo)` is the same as `if (void; foo)` and not `if (foo; void)` and that meant that we didn't check for `self`'s truthiness anymore. This issue became apparent now, because we added a new kind of delayed callback invocation (which is a lot cheaper). This made the lack of a `nullptr` check finally obvious.
- Loading branch information
Showing
2 changed files
with
7 additions
and
7 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