diff --git a/utils/ipc/generators/libcamera_templates/proxy_functions.tmpl b/utils/ipc/generators/libcamera_templates/proxy_functions.tmpl
index 13dc8fdcab6e..8addc2fad0a8 100644
--- a/utils/ipc/generators/libcamera_templates/proxy_functions.tmpl
+++ b/utils/ipc/generators/libcamera_templates/proxy_functions.tmpl
@@ -31,6 +31,8 @@
 	thread_.exit();
 	thread_.wait();
 
+	Thread::current()->dispatchMessages(Message::Type::InvokeMessage);
+
 	running_ = false;
 {%- endmacro -%}
 
