Code review comment for lp:~mconley/globalmenu-extension/fix-segfault-with-lightning

Revision history for this message
Chris Coulson (chrisccoulson) wrote :

Thanks for figuring this out.

I had a thought this morning though. Whilst this fixes the original crash, I think there is still an unsolved issue here that will manifest later on.

The way this is designed, relies on each DbusmenuMenuitem to be inserted in to it's DbusmenuMenuitem parent at the same index as it's corresponding DOM node. If we skip a node, I think everything ends up going off-by-1.

Once this has happened, I think we'll end with bits of the menu ending up in the wrong order as other menuitems are inserted, and we could end up removing the wrong menuitems (or crashing) when nodes are removed.

Does this make sense?

I'm not sure of the best way to fix that, other than creating invisible dummy nodes in the menu, just to keep everything in sync.

review: Needs Information

« Back to merge proposal