NULL ic when we failed to load an image

This commit is contained in:
Mikael Magnusson 2010-01-11 22:48:06 +01:00
parent 567fd15eeb
commit e8b6ead25a

View file

@ -299,8 +299,10 @@ static void parse_menu_item(xmlNodePtr node, gpointer data)
RrImageRef(ic);
else {
ic = RrImageNew(ob_rr_icons);
if (!RrImageAddPictureName(ic, icon))
if (!RrImageAddPictureName(ic, icon)) {
RrImageUnref(ic); /* no need to keep it around */
ic = NULL;
}
}
e->data.normal.icon = ic;