Use SubprocessState in close and destroy