@Override
	public synchronized boolean setReadOnly() throws IOException {

		if (!flush())
			return false;

		if (versionOutFile != null) {
			versionOutFile.close();
			versionOutFile = null;
		}
		if (changeMap != null) {
			changeMap.close();
			changeMap = null;
		}

		super.setReadOnly();

		if (bfMgr != null) {
// TODO: This seems very hidden!
			bfMgr.versionCreated(version, comment, checkinId);
			startPreSave();
		}
		return true;
	}
Output old data for a specified buffer if required for version file.
@param index buffer index
@throws IOException
Ghidra/Framework/DB/src/main/java/db/buffers/LocalManagedBufferFile.java