In the applyStyleToTopLevel function, you are using the widget pointers without verifying it's a valid pointer. So when doing widget->style with a NULL widget pointer it will crash.
Patrice Bernassola
2010-01-18 19:40:30