Fix memory leak in get_gdk_pixbuf() - #252
Conversation
|
Note: GtkIconLookupFlags defines the bits of the flags bitfield, so the value 0 (no flags set) there is fine. |
|
|
||
| theme = gtk_icon_theme_get_default(); | ||
| pixbuf = gtk_icon_theme_load_icon(theme, name, size, | ||
| (GtkIconLookupFlags)0, &error); |
There was a problem hiding this comment.
Hm, but don't we want to keep error? And just free it after? Also this contains some whitespace changes that make reading the diff slightly harder, it would be nice to avoid those for easier review (fwiw, I think eventually we move to the fmt c-lang-format that andy is suggesting then the whole whitespace thing becomes a non-issue :)
There was a problem hiding this comment.
Technically handling all errors is a way to go. But in this particular case we are loading images supplied with the application itself and they suppose to be always present and be loadable.
Another option would be to get rid of this code altogether. See #257
6dd667d to
2e3bce9
Compare
|
Dropping these for now. Will re-implement after I'm back if it's still a topic. |
Changed the gtk_icon_theme_load_icon() call to not retrieve an error object, thus avoiding the memory leak.
(closes amaa-99#134)