Zephyr Workbench, a VSCode extension to manage Zephyr on STM32.
It enables users to easily create, develop, and debug Zephyr applications.
Main features:
Install host dependencies.
Import toolchain and SDK.
Create, configure, build and manage apps.
Debug STM32.
You can directly download it from the VSCode marketplace
For more details, visit the Zephyr Workbench
You appear to be creating but not destroying your dialog box; maybe this is your memory issue?
I’m not familiar with the Segger windowing stuff but maybe ending the dialog from another thread (your usb thread) is not correct.