gtk4-rs icon indicating copy to clipboard operation
gtk4-rs copied to clipboard

Document that the GTK bindings can't be completely safe and document the caveats

Open sdroege opened this issue 3 years ago • 5 comments

Main known issue is related to disposed but not finalized widgets, which would happen when e.g. their surrounding window is closed. Calling anything on such widgets might crash or do whatever, and this is design constraint in GTK.

See https://gitlab.gnome.org/GNOME/gtk/-/issues/3711 for details.

This also effects GTK4, but probably nothing apart from GTK as it's AFAIK the only library calling g_object_run_dispose() explicitly at specific times. It might also affect other GObject libraries if used together with a GC'd language binding in the same process but it's not entirely clear if the problems actually happen there in practice.

CC @bilelmoussaoui

sdroege avatar Mar 03 '21 11:03 sdroege

More specifically, this only applies to widgets and not other GTK objects.

sdroege avatar Mar 03 '21 12:03 sdroege

To be honest, this should probably be part of the gtk-rs book, it is a better place to write about this then in the documentations.

bilelmoussaoui avatar Jan 06 '22 10:01 bilelmoussaoui

@Hofer-Julian What do you think?

sdroege avatar Jan 06 '22 10:01 sdroege

Yeah, the book is probably a good place for that. In a supplementary chapter at the end or so.

Hofer-Julian avatar Jan 06 '22 11:01 Hofer-Julian

Let us move this to gtk4-rs then

bilelmoussaoui avatar Jan 14 '22 10:01 bilelmoussaoui