On Thu Aug 3 15:38:10 2023 +0000, Jinoh Kang wrote:
I'm not sure I understood the "reuse" part. A desktop object be considered alive as long as it has nonzero reference or handle count. In this case, shouldn't the mapping be kept alive as well? If I understood correctly, Proton is basically "resurrecting" the mapping if a desktop object is brought back to the namespace. I'm not sure if trying to release the mapping while the desktop is still technically alive in the first place is a good idea. It comes to me as a bit awkward that we don't bind the lifetime of the mapping to the lifetime of the desktop object itself.
The desktop is unlinked in `close_desktop_timeout`, when it is about to be closed and its name is released. A new desktop with the same name can be created, before the previous one is fully destroyed, ending up re-using the same mapping because it is created with the desktop name.