Fix LCLRefCount warning and possible use-after-free
Verbatim warning text: "WARNING: TMenuItem.Destroy with LCLRefCount>0. Hint: Maybe the component is processing an event?".
This was caused by a complex call chain of miRecentFileExecute() -> OpenMap() -> RefreshRecentMenu() -> RefillRecentMenu(), which result in the sender menu item being removed.
In such cases, Application.ReleaseComponent() should be used.
https://forum.lazarus.freepascal.org/index.php?topic=33591.0 - Topic: [SOLVED] How to delete a button on an OnClick event
https://www.lazarusforum.de/viewtopic.php?p=118333 - [gelöst]Was tun bei: Maybe the component is processing an event?