lxqt / lxqt-config

Tools to configure LXQt and the underlying operating system
https://lxqt.github.io
GNU Lesser General Public License v2.1
79 stars 60 forks source link

Appearance save size use after free #994

Open luis-pereira opened 1 month ago

luis-pereira commented 1 month ago

Also found by ASAN.

tsujan commented 2 weeks ago

I agree that the original code seems problematic with Qt::WA_DeleteOnClose, but, for whatever reason (which I haven't investigated), it correctly saves the size when the dialog is closed in any way, e.g., by the WM or by pressing Escape. That's while the patch saves the size only on pressing the Close button.

EDIT: Most probably, the reason that the original code works fine is that Qt uses deleteLater() when Qt::WA_DeleteOnClose is set.