What do you mean by “The perspective window closes”? There is no perspective window: perspectives are just defining the layout of the Eclipse window (which views/editors are visible and where).
Is this the editor window that closes?
Do you modify the C/C++ perspective layout (opening or moving views)?
How many editor windows are opened?
Which environment are you working in (Windows/Linux/MacOS/X, version, Java version...)
What happens when the “window closes” (another editor opens, the editor pane is empty)?
A few, even low quality, screenshots may help understand your problem; currently nobody can try to reproduce it, or help you correct it..