[Ide] Manually free document fields to help tracking down the memory
leak.