On Tue Jun 20 20:56:57 2023 +0000, Esme Povirk wrote:
I see, the caller addrefs and the event dispatch process indirectly releases by calling uia_lresult_from_node. That's confusing. I also don't understand why this is stored in a VARIANT.
The idea of storing it in a VARIANT is that we can use one generic structure/variable for both clientside and serverside events - a serverside event posts a VARIANT containing an HUIANODE pointer, and a clientside event posts a VARIANT containing an lresult that can be converted into an HUIANODE.
I spent time thinking about this when I designed it, there's a possibility of a delay when converting the lresult into a node. This could cause events to be put into the queue out of sequence, e.g:
- Event 1 arrives, calls `uia_node_from_lresult()` - Event 2 arrives, calls `uia_node_from_lresult()` - `uia_node_from_lresult()` returns for event 2, it gets posted to the queue. - `uia_node_from_lresult()` returns for event 1, it gets posted to the queue.
So IMO, it's best to just post the lresult for the node to the queue quickly and let the event thread do the conversion.
We could also add different structures for each, or a union depending on the type of event in the queue.