The Layout::add functions are called from object constructors. If an
exception is thrown inside them, the constructor will abort and the
object will be deleted. If that happens, it must be removed from the
Layout as well, or an invalid memory access will occur later.