A solar flare model including the formation and destruction of the current sheet in the corona