refs #6447 Added pDoc->release()

Hate to use features I do not understand to the code I have not written but it seems does not do any harm