
PopupMenu.firstMenuItem returns a PopupMenuItem, not an apObj. We need to retrive the latter using the _apObj property. Also, somehow the property from the number of elements in a menu was changed from .length to .numMenuItems, and this broke the destruction of the menu upon emptying it. https://bugzilla.gnome.org/show_bug.cgi?id=659277