Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix small get_res_icon_path() widget leak
`horizons.gui.util.get_res_icon_path()` does the same thing as as
`horizons.gui.widgets.imagebuton`: aks fife to create an `Icon()` to
see if it's a valid image path. But other than the `ImageButton`,
`get_res_icon_path()` did forget to call `hide()` on that `Icon`. So the
`Icon` stayed alive, even though unused.

We now call `hide()` on that `Icon`.
  • Loading branch information
MasterofJOKers committed Jan 28, 2017
1 parent 15ac975 commit 25e9332
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion horizons/gui/util.py
Expand Up @@ -125,7 +125,7 @@ def get_res_icon_path(res, size=32, greyscale=False, full_path=True):
icon_path = icon_path + '{res:03d}.png'.format(res=res)

try:
Icon(image=icon_path)
Icon(image=icon_path).hide()
except fife.NotFound: # ImageManager: image not found, use placeholder or die
if res == 'placeholder':
raise Exception('Image not found: {icon_path}'.format(icon_path=icon_path))
Expand Down

0 comments on commit 25e9332

Please sign in to comment.