[Ide] Help the GC to free managed object references.
For some reason the profiler says they're kept in memory, but the real
problem is that the menu items contain references to Documents (Text
editor etc.). That's causing a leak.