Commit 640bdd9a authored by Jody Goldberg's avatar Jody Goldberg

Hopefully fix problem with dangling dependancies.

parent 55385cc1
......@@ -19,6 +19,7 @@
(cell_drop_dependencies) : Ditto.
(region_get_dependencies) : Ditto.
(cell_get_dependencies) : Ditto.
(add_cell_range_dep) : Increment ref_count AFTER looking for duplicates.
* src/workbook.c (workbook_do_destroy) : Add some debugging code to
catch dangling dependancies.
......
......@@ -19,6 +19,7 @@
(cell_drop_dependencies) : Ditto.
(region_get_dependencies) : Ditto.
(cell_get_dependencies) : Ditto.
(add_cell_range_dep) : Increment ref_count AFTER looking for duplicates.
* src/workbook.c (workbook_do_destroy) : Add some debugging code to
catch dangling dependancies.
......
......@@ -113,20 +113,18 @@ static void
add_cell_range_dep (Cell *cell, DependencyRange const * const range)
{
/* Look it up */
DependencyRange *result = g_hash_table_lookup (cell->sheet->dependency_hash,
range);
DependencyRange *result =
g_hash_table_lookup (cell->sheet->dependency_hash, range);
if (result){
GList *cl;
result->ref_count++;
/* Is the cell already listed? */
cl = g_list_find (result->cell_list, cell);
GList const *cl = g_list_find (result->cell_list, cell);
if (cl)
return;
/* It was not: add it */
result->cell_list = g_list_prepend (result->cell_list, cell);
result->ref_count++;
return;
}
......
......@@ -113,20 +113,18 @@ static void
add_cell_range_dep (Cell *cell, DependencyRange const * const range)
{
/* Look it up */
DependencyRange *result = g_hash_table_lookup (cell->sheet->dependency_hash,
range);
DependencyRange *result =
g_hash_table_lookup (cell->sheet->dependency_hash, range);
if (result){
GList *cl;
result->ref_count++;
/* Is the cell already listed? */
cl = g_list_find (result->cell_list, cell);
GList const *cl = g_list_find (result->cell_list, cell);
if (cl)
return;
/* It was not: add it */
result->cell_list = g_list_prepend (result->cell_list, cell);
result->ref_count++;
return;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment