steinbergmedia / vstgui

A user interface toolkit mainly for audio plug-ins
Other
850 stars 121 forks source link

Secure calling isVisible () #283

Closed HERE-SDK-Support-Team closed 1 year ago

HERE-SDK-Support-Team commented 1 year ago

Proposing to check if pImpl is not destroyed. As otherwise, an implementation may call isVisible () on a CView that is already closed due to a race condition.

scheffle commented 1 year ago

Hi @HERE-SDK-Support-Team , can you please provide a test case for this issue. I've a hard time to understand how this should be possible at all. The pImpl is the last that is destroyed in a view. So if you are crashing in this call, then you are already doing something wrong.

HERE-SDK-Support-Team commented 1 year ago

Correct. This seems to happen only when there is misuse: For example, when a thread redraws the view, this may happen when calling isVisible() inside the view's draw() override after opening the VSTGUI editor (which seems to destroy the view). Switching to Steinberg::Timer will avoid such issues as it seems to be synchronized with the UI thread. Closing. Thanks for the feedback!