mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-10-02 18:36:53 -04:00
UI: Fix memory leak with Manage Broadcast dialog
When OBS has been connected to a YouTube account, the Manage Broadcast dialog becomes available. Opening and closing this dialog leaks about 2-3 MB of memory each time. This happens because the dialog is never deleted, and a new object is created every time the dialog opens. If we set Qt::WA_DeleteOnClose on the dialog, then the dialog->exec() call would call delete this. However, if the dialog->Valid() call returned false (this should currently be impossible), then exec is never called, so it would not clean up. To fix this, make the dialog stack-allocated instead of using new and delete. Detected by clang-analyzer.
This commit is contained in:
500 Internal Server Error
Gitea Version: 1.28.0+dev-477-g8b6ad49a5f