From 99cda9c990da9eb503fd6b3f5ff4c84906fe353b Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Dec 05 2008 15:03:10 +0000 Subject: Fix crash with glib-2.19. (#474511, ) --- diff --git a/gnucash-2.2.7-glib2-int-key.patch b/gnucash-2.2.7-glib2-int-key.patch new file mode 100644 index 0000000..499a655 --- /dev/null +++ b/gnucash-2.2.7-glib2-int-key.patch @@ -0,0 +1,51 @@ +--- src/register/register-gnome/gnucash-sheet.c~ 2008-01-07 20:05:28.000000000 -0500 ++++ src/register/register-gnome/gnucash-sheet.c 2008-12-04 16:01:47.000000000 -0500 +@@ -2367,7 +2367,8 @@ + sheet->width = 0; + sheet->height = 0; + +- sheet->cursor_styles = g_hash_table_new (g_str_hash, g_str_equal); ++ sheet->cursor_styles = g_hash_table_new_full (g_str_hash, g_str_equal, ++ g_free, NULL); + + sheet->blocks = g_table_new (sizeof (SheetBlock), + gnucash_sheet_block_construct, +@@ -2426,8 +2427,9 @@ + sheet->grid = item; + + /* some register data */ +- sheet->dimensions_hash_table = g_hash_table_new (g_int_hash, +- g_int_equal); ++ sheet->dimensions_hash_table = g_hash_table_new_full (g_int_hash, ++ g_int_equal, ++ g_free, NULL); + + /* The cursor */ + sheet->cursor = gnucash_cursor_new (sheet_group); +--- src/register/register-gnome/gnucash-style.c~ 2008-12-04 14:59:49.000000000 -0500 ++++ src/register/register-gnome/gnucash-style.c 2008-12-04 16:01:47.000000000 -0500 +@@ -48,6 +48,15 @@ + return &key; + } + ++static gpointer ++style_create_key (SheetBlockStyle *style) ++{ ++ static gint key; ++ ++ key = style->cursor->num_rows; ++ ++ return g_memdup(&key, sizeof(key)); ++} + + static void + cell_dimensions_construct (gpointer _cd, gpointer user_data) +@@ -103,7 +112,7 @@ + if (!dimensions) { + dimensions = style_dimensions_new (style); + g_hash_table_insert (sheet->dimensions_hash_table, +- style_get_key (style), dimensions); ++ style_create_key (style), dimensions); + } + + dimensions->refcount++; diff --git a/gnucash.spec b/gnucash.spec index 292475b..b35369e 100644 --- a/gnucash.spec +++ b/gnucash.spec @@ -15,7 +15,8 @@ BuildRequires: libglade2-devel >= 2.3.6, libgnomeprint22-devel >= 2.8.0 BuildRequires: libofx-devel, aqbanking-devel, guile-devel BuildRequires: desktop-file-utils, texinfo BuildRequires: gettext, slib >= 3a1-5, libtool, intltool -Patch: gnucash-quiet.patch +Patch0: gnucash-quiet.patch +Patch1: gnucash-2.2.7-glib2-int-key.patch Requires: gnucash-docs >= 2.2.0 Requires: slib >= 3a1-5 Requires: perl(Finance::Quote) @@ -36,7 +37,8 @@ balanced books. %prep %setup -q -%patch -p1 +%patch0 -p1 +%patch1 -p0 find src/quotes -name "*.in" -exec sed -i "s|use lib '@-PERLINCL-@';||g" {} \; %build @@ -128,6 +130,9 @@ fi %doc doc/README.german doc/README.francais doc/guile-hackers.txt %changelog +* Fri Dec 5 2008 Bill Nottingham - 2.2.7-2 +- fix crash with glib-2.19 (#474511, ) + * Tue Sep 30 2008 Bill Nottingham - 2.2.7-1 - update to 2.2.7