# FlushMsg() throwing error if queue empty?

**URL:** <https://resource.dopus.com/t/flushmsg-throwing-error-if-queue-empty/51744>\
**Category:** Help & Support\
**Created:** [July 10, 2024, 7:50am UTC](https://resource.dopus.com/t/flushmsg-throwing-error-if-queue-empty/51744 "2024-07-10T07:50:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![galaxyhub](https://resource.dopus.com/user_avatar/resource.dopus.com/galaxyhub/32/42793_2.png) [@galaxyhub](https://resource.dopus.com/u/galaxyhub)\
**Post date:** [July 10, 2024, 7:50am UTC](https://resource.dopus.com/t/flushmsg-throwing-error-if-queue-empty/51744/1 "2024-07-10T07:50:08Z")

</div>

Remembered to use KillTimer() after my message loop and the FlushMsg() that was being used started giving an _undefined_ error - presumably because the queue is now empty.

---

<div class="post-metadata">

**Author:** ![Jon](https://resource.dopus.com/user_avatar/resource.dopus.com/jon/32/12713_2.png) [@Jon](https://resource.dopus.com/u/Jon)\
**Post date:** [July 10, 2024, 8:31am UTC](https://resource.dopus.com/t/flushmsg-throwing-error-if-queue-empty/51744/2 "2024-07-10T08:31:44Z")

</div>

No, it won't throw an error in that situation. But if your message loop has exited and the dialog no longer exists, it might. No reason to call it if the dialog is gone.
