Original commit message from CVS: only open/close library during state changes, not creation/disposal