diff --git a/src/debug.c b/src/debug.c
index 17a07fc..bf23214 100644
--- a/src/debug.c
+++ b/src/debug.c
@@ -92,6 +92,8 @@ int dbg_printf(const char *fmt, ...)
     ret = vfprintf(stdout, fmt, args);
     va_end(args);
 
+    fflush(stdout);
+
     LeaveCriticalSection(&cs);
 
     return ret;