In case there is nothing output yet to the buffer and then implementing the ob_clean() a (soft) error notice would be generated such as the following:
Notice: ob_clean() [ref.outcontrol]: failed to delete buffer. No buffer to delete. in [file-path]
you could do a simple check with "ob_get_contents()" to make sure that there is anything in the buffer.