SF.net SVN: geany: [1148] trunk

ntrel at users.sourceforge.net ntrel at xxxxx
Sat Dec 30 11:49:48 UTC 2006


Revision: 1148
          http://svn.sourceforge.net/geany/?rev=1148&view=rev
Author:   ntrel
Date:     2006-12-30 03:49:47 -0800 (Sat, 30 Dec 2006)

Log Message:
-----------
Don't use gtk_rc_get_style() in ui_update_tab_status() because it
can cause an invalid memory read on some systems.

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/src/ui_utils.c

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2006-12-26 15:49:35 UTC (rev 1147)
+++ trunk/ChangeLog	2006-12-30 11:49:47 UTC (rev 1148)
@@ -1,3 +1,10 @@
+2006-12-30  Nick Treleaven  <nick.treleaven at btinternet.com>
+
+ * src/ui_utils.c:
+   Don't use gtk_rc_get_style() in ui_update_tab_status() because it
+   can cause an invalid memory read on some systems.
+
+
 2006-12-26  Nick Treleaven  <nick.treleaven at btinternet.com>
 
  * tagmanager/tm_tag.c, tagmanager/include/tm_tag.h:

Modified: trunk/src/ui_utils.c
===================================================================
--- trunk/src/ui_utils.c	2006-12-26 15:49:35 UTC (rev 1147)
+++ trunk/src/ui_utils.c	2006-12-30 11:49:47 UTC (rev 1148)
@@ -1179,16 +1179,11 @@
 void ui_update_tab_status(gint idx)
 {
 	GdkColor *color = document_get_status(idx);
-	static GtkStyle *style = NULL;
 
-	if (style == NULL) // use and store default foreground colour
-		style = gtk_rc_get_style(doc_list[idx].tab_label);
+	// NULL color will reset to default
+	gtk_widget_modify_fg(doc_list[idx].tab_label, GTK_STATE_NORMAL, color);
+	gtk_widget_modify_fg(doc_list[idx].tab_label, GTK_STATE_ACTIVE, color);
 
-	gtk_widget_modify_fg(doc_list[idx].tab_label, GTK_STATE_NORMAL,
-		color ? color : &(style->fg[GTK_STATE_NORMAL]));
-	gtk_widget_modify_fg(doc_list[idx].tab_label, GTK_STATE_ACTIVE,
-		color ? color : &(style->fg[GTK_STATE_ACTIVE]));
-
 	treeviews_openfiles_update(idx);
 }
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Commits mailing list