Random crashes on PlatGTK

5 views
Skip to first unread message

Mitchell

unread,
Sep 30, 2021, 4:26:02 PM9/30/21
to Scintilla mailing list
Hi Neil,

After updating to Scintilla 5.1.3, I'm getting random crashes when running an automated GUI test suite for my application. I've tracked it down to
changeset 8928 (96abb4601a74) Hold onto global GtkSettings object as used multiple times.

+ if (settings) {
+ g_object_unref(settings);
+ }

If I uncomment this block from the changeset, the crashes go away. I think unrefing the default settings is probably not a good idea, but I don't know enough about Gtk internals to say that definitively. My application has multiple Scintilla views, so perhaps that is the cause.

Cheers,
Mitchell

Neil Hodgson

unread,
Oct 1, 2021, 7:34:10 PM10/1/21
to Scintilla mailing list
Mitchell:

> + if (settings) {
> + g_object_unref(settings);
> + }
>
> If I uncomment this block from the changeset, the crashes go away. I think unrefing the default settings is probably not a good idea, but I don't know enough about Gtk internals to say that definitively.

Yes, removed the undef.
https://sourceforge.net/p/scintilla/code/ci/db178448ae7a1049853c8e6e2cdba6f798ec1ed5/

In the GTK 2 documentation, gtk_settings_get_default is marked “transfer none” and in GTK 3 and 4 it has “The data is owned by the called function.”
https://docs.gtk.org/gtk3/type_func.Settings.get_default.html

Neil

Reply all
Reply to author
Forward
0 new messages