]> Shamusworld >> Repos - apple2/blobdiff - src/log.cpp
Fixed log hangup on exit, added paddle buttons 0 & 1.
[apple2] / src / log.cpp
index e56a55727157c78628253035d4f1812972eab708..4a01f8001153f0fb3868382ec3483a2f921043c5 100755 (executable)
@@ -57,15 +57,15 @@ void WriteLog(const char * text, ...)
 
        va_start(arg, text);
        logSize += vfprintf(log_stream, text, arg);
+       va_end(arg);
+
+       fflush(log_stream);                                     // Make sure that text is written!
 
        if (logSize > MAX_LOG_SIZE)
        {
-               fflush(log_stream);
                fclose(log_stream);
+               log_stream = NULL;
                logDone = true;
        }
-
-       va_end(arg);
-       fflush(log_stream);                                     // Make sure that text is written!
 }