Skip to content
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

[Core] Multiple floating elements without ID causes segfault #149

Open
sammonius opened this issue Jan 2, 2025 · 1 comment
Open

[Core] Multiple floating elements without ID causes segfault #149

sammonius opened this issue Jan 2, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@sammonius
Copy link

If there's more than one floating element being drawn without an explicit ID, the program crashes with a segmentation fault. I'm not sure if this is because floating elements don't have automatic ID's or for another reason.

(If this can't be fixed, it should at least be documented)

        // causes crash
        CLAY(CLAY_LAYOUT({.sizing = {CLAY_SIZING_GROW(), CLAY_SIZING_GROW()}})){
			CLAY(CLAY_FLOATING({}), CLAY_RECTANGLE({ .color = {255,255,255,255} })){ CLAY(){} }
			CLAY(CLAY_FLOATING({}), CLAY_RECTANGLE({ .color = {255,255,255,255} })){ CLAY(){} }
        }

        // doesn't cause crash
        CLAY(CLAY_LAYOUT({.sizing = {CLAY_SIZING_GROW(), CLAY_SIZING_GROW()}})){
			CLAY(CLAY_ID(("A"), CLAY_FLOATING({}), CLAY_RECTANGLE({ .color = {255,255,255,255} })){ CLAY(){} }
			CLAY(CLAY_ID(("B"), CLAY_FLOATING({}), CLAY_RECTANGLE({ .color = {255,255,255,255} })){ CLAY(){} }
        }

I've also tested it with IDI's and it doesn't crash if the indicies are different. I haven't tested what would happen if one has an ID and one doesn't, though.

@nicbarker nicbarker changed the title Multiple floating elements without ID causes segfault [Core] Multiple floating elements without ID causes segfault Jan 2, 2025
@nicbarker nicbarker added the bug Something isn't working label Jan 2, 2025
@nicbarker
Copy link
Owner

Thanks for raising this one, definitely sounds like a bug so I'll get it fixed up for you 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants