[626] in BarnOwl Developers
[D-O-H] r726 - / trunk/owl
daemon@ATHENA.MIT.EDU (nelhage@MIT.EDU)
Thu Oct 29 18:08:04 2009
Resent-From: nelhage@mit.edu
Resent-To: barnowl-dev-mtg@charon.mit.edu
To: dirty-owl-hackers@mit.edu
From: nelhage@MIT.EDU
Reply-to: dirty-owl-hackers@MIT.EDU
Date: Mon, 4 Jun 2007 00:46:56 -0400 (EDT)
Author: nelhage
Date: 2007-06-04 00:46:55 -0400 (Mon, 04 Jun 2007)
New Revision: 726
Modified:
/
trunk/owl/global.c
Log:
r22012@phanatique: nelhage | 2007-06-04 00:46:36 -0400
Don't corrupt the current style pointer if we redefine the current
style.
Property changes on:
___________________________________________________________________
Name: svk:merge
- 6122c8b4-0e12-0410-9533-8bcd7c66c992:/local/dirty-owl-hacks:24493
6aa88b72-b502-0410-8cb4-a5dd0230fb79:/owl-local:1356
bb873fd7-8e23-0410-944a-99ec44c633eb:/local/barnowl:22008
bb873fd7-8e23-0410-944a-99ec44c633eb:/local/d-o-h:18636
+ 6122c8b4-0e12-0410-9533-8bcd7c66c992:/local/dirty-owl-hacks:24493
6aa88b72-b502-0410-8cb4-a5dd0230fb79:/owl-local:1356
bb873fd7-8e23-0410-944a-99ec44c633eb:/local/barnowl:22012
bb873fd7-8e23-0410-944a-99ec44c633eb:/local/d-o-h:18636
Modified: trunk/owl/global.c
===================================================================
--- trunk/owl/global.c 2007-06-01 08:01:55 UTC (rev 725)
+++ trunk/owl/global.c 2007-06-04 04:46:55 UTC (rev 726)
@@ -816,8 +816,16 @@
void owl_global_add_style(owl_global *g, owl_style *s)
{
- owl_dict_insert_element(&(g->styledict), owl_style_get_name(s),
- s, (void(*)(void*))owl_style_free);
+ /*
+ * If we're redefining the current style, make sure to update
+ * pointers to it.
+ */
+ if(g->current_view.style
+ && !strcmp(owl_style_get_name(g->current_view.style),
+ owl_style_get_name(s)))
+ g->current_view.style = s;
+ owl_dict_insert_element(&(g->styledict), owl_style_get_name(s),
+ s, (void(*)(void*))owl_style_free);
}
void owl_global_set_haveaim(owl_global *g)