This method of the RegKey class closes a key when it is no longer needed.
public void close();
As the system registry keys must be written out to disk, the keys must be closed when no longer needed. After this, the keys must not be used again.