Re: segfault using extension events in Gtk2's scribble.pl



gvb <postdoc38 yahoo fr>:
Thanks a lot for your reply. I've been able to solve the problem (see code
below: grabbing the device list without reference to the main window works a
charm...). I don't understand why the above method failed (the display has a
devices_list method, and it reports the same list as
Gtk2::Gdk->devices_list()), but I can live with that ;-)

Ah, I think I see the problem then.  We free the list returned by gdk_display_list_devices:

https://git.gnome.org/browse/perl-Gtk2/tree/xs/GdkDisplay.xs#n59

But its docs state that "[t]he list is statically allocated and should not be freed."

https://developer.gnome.org/gdk2/stable/GdkDisplay.html#gdk-display-list-devices

So the g_list_free call needs to be removed.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]