Closed tom-a-wagner closed 3 years ago
You can't just execute the main widget, you need at least an application...
You can't just execute the main widget, you need at least an application...
Yes, I minified the example to show the segfault.
Simplified as in removed the gtk::application code or what exactly?
Simplified as in removed the gtk::application code or what exactly?
Yes, this is an example taken from a real program that caused a segmentation failure because it created a custom widget before the applications activate
callback called.
The point is not that this does not work, because obviously it can't without an application, but that I consider this bug because it would expect the code to cause a panic, not a segmention failure.
Indeed, we somehow have to add our initialization checks also into the subclass code.
It would probably make sense to put it here https://github.com/gtk-rs/gtk4-rs/blob/8d674b0e61f4f42f7ddf57143d96fe81bfdc4051/gtk4/src/subclass/widget.rs#L578-L582
And the same for all other non-widget types in gtk4.
This of course also applies to gtk3-rs.
Instead of panicking like normal widgets, creating a custom widget causes a SIGSEGV on my machine running Fedora 34, gtk4 4.2.1 and gtk4-rs from master.
Backtrace: