Re: boxed re-registration key freeing



Kevin Ryde wrote:
With the current cvs the foo.pl below gets an error,

    type Gtk2::Border is not registered with Glib-Perl at foo.pl line 8.

Chasing it down in gdb it looks like Gtk2.xs register.xsh registers
Gtk2::Border with gperl_register_boxed, and then the Gtk2::Entry boot
code re-registers it.  On that second registration the info_by_gtype
update frees the boxed_info of the first registration, but the package
name string "Gtk2::Border" in that boxed_info is still in use as the key
in info_by_package.  Changing g_hash_table_insert to
g_hash_table_replace to update the key in info_by_package seems to do
the trick.

Well spotted! I think I introduced this bug while fixing another, related bug earlier. I applied your patch, and also made similar changes to the other type registration functions. Thanks!

Unfortunately, I didn't think of this before rolling Glib 1.212, so it still has the bug. But the upcoming stable release won't.



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