Fix holes in IObservableVector<IInspectable> #544
Merged
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.
ReplaceAll did not provide the strong exception guarantee: If not all the elements could be converted to T, the code left the vector in a partially-replaced state. Now it leaves the vector unchanged if the operation fails. (Note that vector_base::assign does not provide the strong exception guarantee if wrapping is required, so we can't quite declare victory yet.)
If the underlying vector is a vector of value types, then attempting to insert nullptr now fails with E_NOINTERFACE rather than crashing.
If the object's runtime type is not T, then IndexOf should report "not found" rather than reporting the index of the first nullptr (if T is a reference type) or crashing (if T is a value type). This fixes issue #518.
Fixed use-after-free bug in test, where we forgot to unregister event handlers, leaving them with references to destroyed local variables.