-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SDL_SetObjectsInvalid
assertion failure when closing a minimal tray example
#11893
Comments
@Semphriss, can you take a look at this? |
Taking a look at this, I get a "Leaked thread (0xaddress)", but I get no assertion error. I compiled using the latest commit on the main branch (00b23a0). I'll investigate the threading issue and see if I randomly get the assertion error. What system is this? I'll try to see if this is a system-specific issue. |
The error happens every execution on my system. So it's not random at all (for me).
My system is Fedora 39 (which is EOL). If I add Also, I built SDL3 with |
We currently don't clean up trays on quit, maybe we should? Technically what you're doing (leaking a tray) is resulting in the expected behavior. |
I can make trays clean up on quit if it can help, but I'd like to investigate the bug further. Bugs like this can sometimes be symptomatic of another problem, and I'd like to see if it can cause other issues down the line, other than on quit. |
I also just had a random crash, which might have been triggered by changing the icon, not sure:
commit 22422f7 (3.1.8) I could not reproduce this yet, but I also had a situation where the menu just stopped working (no longer poped up when clicking the icon). edit: caught another crash on exit this time:
edit2: it seems to have taken another program with it (unrelated program also having a tray icon) until i ended the debugging session. |
@Green-Sky, please create new issues for individual crashes, thanks! |
@Semphriss, let's go ahead and clean up the trays when the video subsystem is shutdown. Conceptually they're linked, right? |
It's technically separate, but it depends on video-related functions for the icon handling (SDL_Surface). I can keep a list of trays and destroy them on quit. In the event someone unwisely destroys their trays after SDL_Quit()ting, should I ensure that destroying a tray twice does not result in double-frees? |
That sounds good.
You can add tray as a new object type in SDL_utils_c.h and use the related functions to validate the pointers, take a look at SDL_OBJECT_TYPE_WINDOW as an example. |
Using the minimal tray example from #11892, I get an assertion failure when closing the window, or pressing
CTRL+C
These are the messages printed on stdout:
This is the backtrace:
The text was updated successfully, but these errors were encountered: