Also, I don't see the need of using a weak ref here. Menu items are short lived, so there reference should go away soon. In any case a simpler solution is to just set lastCmdInfo=null in OnDestroyed.