"sourceview5::StyleSchemePreview::new()" seems to mess up with refcounting
Using sourceview5::StyleSchemePreview::new()
to construct GtkSourceStyleSchemePreview widgets on Rust seems to destroy the widget before it even has a chance to being used. Merely calling this function, without any particular usage, results in the following warning:
(spiel:2): Gtk-WARNING **: 18:52:28.944: A floating object was finalized. This means that someone
called g_object_unref() on an object that had only a floating
reference; the initial floating reference is not owned by anyone
and must be removed with g_object_ref_sink().
If you try to add this widget to any other widget, you'd get:
(spiel:2): Gtk-CRITICAL **: 18:50:06.224: GtkSourceStyleSchemePreview 0x562307512af0 has a parent GtkFlowBoxChild 0x562307481000 during dispose. Parents hold a reference, so this should not happen.
Did you call g_object_unref() instead of gtk_widget_unparent()?