Closed alexisperin closed 3 months ago
Will it help, if you call QApplication::processEvents()
right before you call restoreState()
?
Thank you for your answer. Calling processEvents()
doesn't solve my problem, it looks like DeferredDelete events are handled differently than others (https://doc.qt.io/qt-6/qcoreapplication.html#processEvents).
The fix I currently have is to queue the call to restoreState()
. This makes sure it is executed after the deleteLater
. I am just wondering if there is something you could do on your side to avoid such a workaround ?
At the moment you are the only one with this issue so please use your work around.
Hello,
I came across a nasty bug using the library. What happened is I called
deleteDockWidget
on a floating CDockWidget (which calls adeleteLater
in your implementation) and right after that I calledrestoreState
on the CDockManager to load an other configuration that also contains a floating CDockWidget. TherestoreState
method is called before thedeleteLater
but once thedeleteLater
is executed my application crashes.I guess what happens is
restoreState
tries to re-use the CDockContainer of the floating widget I was trying to delete and that container is then deleted too once thedeleteLater
is executed on the floating widget.There is no doubt that this kind bug was unpredictable. But I would be very gratefull if you could take a look at was is possible to do to add some more security in the code and prevent such a crash.
Thanks,
Alexis