On Mon Nov 21 15:47:02 2022 +0000, Jacek Caban wrote:
You could, for example, have separated reference to performance_obj instead of sharing it with VARIANT, so it's kept alive until window is destroyed even if performance property is changed. Depending on how you solve circular reference problem, you may need it anyway.
Yeah, I went with a different approach right now, without storing any refs to the window or doing any detach shenanigans. Create the performance timing on inner window creation, and always keep it alive from the window, so the window just sets the props on it directly.
Only thing "special" is that the dispex is not initialized right away, but only when the performance obj is obtained, due to compat mode having to be deferred (can't do it at window creation).
But I think this is far simpler than having to do two detach stuff and more complicated logic, it's also a lot less code in each getter (no check for NULL window), and works even if the window is "detached" while timing is still up.