Revision: 771 Author: eht16 Date: 2006-08-28 09:27:16 -0700 (Mon, 28 Aug 2006) ViewCVS: http://svn.sourceforge.net/geany/?rev=771&view=rev
Log Message: ----------- Fixed a crash when switching between several filetypes.
Modified Paths: -------------- trunk/ChangeLog trunk/src/treeviews.c trunk/src/utils.c Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2006-08-28 15:07:48 UTC (rev 770) +++ trunk/ChangeLog 2006-08-28 16:27:16 UTC (rev 771) @@ -2,6 +2,8 @@
* geany.glade, src/interface.c: Fixed typo in a tooltip text. * THANKS, src/about.c: Added translator credits. + * src/treeviews.c, src/utils.c: + Fixed a crash when switching between several filetypes.
2006-08-27 Frank Lanitz frank@frank.uvena.de
Modified: trunk/src/treeviews.c =================================================================== --- trunk/src/treeviews.c 2006-08-28 15:07:48 UTC (rev 770) +++ trunk/src/treeviews.c 2006-08-28 16:27:16 UTC (rev 771) @@ -58,6 +58,17 @@
void treeviews_init_tag_list(gint idx) { + // init all GtkTreeIters with -1 to make them invalid to avoid crashes when switching between + // filetypes(e.g. config file to Python crashes Geany without this) + tv.tag_function.stamp = -1; + tv.tag_class.stamp = -1; + tv.tag_member.stamp = -1; + tv.tag_macro.stamp = -1; + tv.tag_variable.stamp = -1; + tv.tag_namespace.stamp = -1; + tv.tag_struct.stamp = -1; + tv.tag_other.stamp = -1; + switch (doc_list[idx].file_type->id) { case GEANY_FILETYPES_DOCBOOK:
Modified: trunk/src/utils.c =================================================================== --- trunk/src/utils.c 2006-08-28 15:07:48 UTC (rev 770) +++ trunk/src/utils.c 2006-08-28 16:27:16 UTC (rev 771) @@ -742,6 +742,7 @@ case tm_tag_prototype_t: case tm_tag_function_t: { + if (tv.tag_function.stamp == -1) break; gtk_tree_store_append(doc_list[idx].tag_store, &iter, &(tv.tag_function)); gtk_tree_store_set(doc_list[idx].tag_store, &iter, 0, ((GeanySymbol*)tmp->data)->str, -1); break; @@ -749,18 +750,21 @@ case tm_tag_macro_t: case tm_tag_macro_with_arg_t: { + if (tv.tag_macro.stamp == -1) break; gtk_tree_store_append(doc_list[idx].tag_store, &iter, &(tv.tag_macro)); gtk_tree_store_set(doc_list[idx].tag_store, &iter, 0, ((GeanySymbol*)tmp->data)->str, -1); break; } case tm_tag_class_t: { + if (tv.tag_class.stamp == -1) break; gtk_tree_store_append(doc_list[idx].tag_store, &iter, &(tv.tag_class)); gtk_tree_store_set(doc_list[idx].tag_store, &iter, 0, ((GeanySymbol*)tmp->data)->str, -1); break; } case tm_tag_member_t: { + if (tv.tag_member.stamp == -1) break; gtk_tree_store_append(doc_list[idx].tag_store, &iter, &(tv.tag_member)); gtk_tree_store_set(doc_list[idx].tag_store, &iter, 0, ((GeanySymbol*)tmp->data)->str, -1); break; @@ -770,24 +774,28 @@ case tm_tag_union_t: case tm_tag_struct_t: { + if (tv.tag_struct.stamp == -1) break; gtk_tree_store_append(doc_list[idx].tag_store, &iter, &(tv.tag_struct)); gtk_tree_store_set(doc_list[idx].tag_store, &iter, 0, ((GeanySymbol*)tmp->data)->str, -1); break; } case tm_tag_variable_t: { + if (tv.tag_variable.stamp == -1) break; gtk_tree_store_append(doc_list[idx].tag_store, &iter, &(tv.tag_variable)); gtk_tree_store_set(doc_list[idx].tag_store, &iter, 0, ((GeanySymbol*)tmp->data)->str, -1); break; } case tm_tag_namespace_t: { + if (tv.tag_namespace.stamp == -1) break; gtk_tree_store_append(doc_list[idx].tag_store, &iter, &(tv.tag_namespace)); gtk_tree_store_set(doc_list[idx].tag_store, &iter, 0, ((GeanySymbol*)tmp->data)->str, -1); break; } default: { + if (tv.tag_other.stamp == -1) break; gtk_tree_store_append(doc_list[idx].tag_store, &iter, &(tv.tag_other)); gtk_tree_store_set(doc_list[idx].tag_store, &iter, 0, ((GeanySymbol*)tmp->data)->str, -1); }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.