++ finish resource management