Hmm, I haven't noticed that. If I close a query window the last line is then written to the log along with the "Session Close:" line.

However if mIRC was killed or the OS crashed etc these last lines would never get a chance to write..