You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, trying to use some builders before initializing GTK can cause a segfault. Instead, the generated builder should check if GTK has been initialized, and panic if not.
Minimal example
use gtk4::prelude::*;use gtk4::{Application,ApplicationWindow, glib};constAPP_ID:&str = "me.annahope.gtk4-rs-segfault";fnbuild_ui(app:&Application){let window = ApplicationWindow::builder().application(app).title("Segfault").build();// Segfaults if GTK hasn't been initialized.
window.present();}fnmain() -> glib::ExitCode{let app = Application::builder().application_id(APP_ID).build();// app.connect_activate(build_ui);build_ui(&app);// Segfaults.
app.run()}
I tried fixing this naively by adding a check to the builder codegen code anna-hope@a3ee252, but then realized that we definitely can't do this for all builders because:
I briefly investigated the builder_properties to see if we could set some field there, but couldn't find an easy way to add one. I could look into it further, but I am brand new to this project and GTK overall, so perhaps there is a better way to accomplish this that I don't know about.
The text was updated successfully, but these errors were encountered:
Currently, trying to use some builders before initializing GTK can cause a segfault. Instead, the generated builder should check if GTK has been initialized, and panic if not.
Minimal example
I tried fixing this naively by adding a check to the builder codegen code anna-hope@a3ee252, but then realized that we definitely can't do this for all builders because:
I briefly investigated the
builder_properties
to see if we could set some field there, but couldn't find an easy way to add one. I could look into it further, but I am brand new to this project and GTK overall, so perhaps there is a better way to accomplish this that I don't know about.The text was updated successfully, but these errors were encountered: