`mCurrentDT` was added in bug 1874241, perhaps aosmond can help with this. And cc Lee as he reviewed that, and wrote the fix for 1929911. Certainly at the very least it seems `AddDrawTarget()` needs to reset `mCurrentDT` if it points to a draw target that is being replaced. `mCurrentDT` being `WeakPtr` rather than a raw pointer could also add peace of mind. But are multiple `AddDrawTarget()` calls with the same `aRefPtr` value valid without a `RemoveDrawTarget()` in between? Should we just crash in such cases? Same question applies to the other Add methods as Andrew points out, as even if we don't currently retain any raw pointers to them you could imagine someone adding them in the future without realising the danger.
Bug 1984825 Comment 4 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
`mCurrentDT` was added in bug 1874241, perhaps aosmond can help with this. And cc Lee as he reviewed that, and wrote the fix for 1929911. Certainly at the very least it seems `AddDrawTarget()` needs to reset `mCurrentDT` if it points to a draw target that is being replaced. `mCurrentDT` being `WeakPtr` rather than a raw pointer could also add peace of mind. But are multiple `AddDrawTarget()` calls with the same `aRefPtr` value valid without a `RemoveDrawTarget()` in between ever valid? Should we just crash in such cases? Same question applies to the other Add methods as Andrew points out, as even if we don't currently retain any raw pointers to them you could imagine someone adding them in the future without realising the danger.