proper cleanup on destruction of docviewer scope fixes #168