Community
Participate
Working Groups
When we to a Restart operation, we re-create the GDBInferiorProcess, but we don't dispose of the old one, which surely leads to memory leaks.
I thought the solution would simply be to call MIInferiorProcess#dispose() before creating the new one, but it was not that easy. MIInferiorProcess#dispose() calls setState(State.TERMINATED) which makes the launch believe that gdb is terminated. We'll have to look into if this call to setState() should be in dispose() or not. This is not urgent.
With the recent changes to MIInferiorProcess, there is no longer a memory leak. Once the debug session is terminated, all MIInferiorProcess classes will be disposed. However, it would be better to call dispose() whenever a process is terminated, to avoid having those objects linger around when they are not used anymore. We should probably simply call dispose() instead of setTerminated() in MIInferiorProcess. I am just worried about closing the streams to early. I'd have to give it more thought and testing, which is too late for Indigo (and not important enough).