Skip to content

Commit

Permalink
QML UI: Avoid crashes with zero refcounts
Browse files Browse the repository at this point in the history
  • Loading branch information
thp committed Dec 22, 2012
1 parent b4cbdcc commit bd22025
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/gpodder/qmlui/__init__.py
Expand Up @@ -806,6 +806,7 @@ def __init__(self, config, root):
gPodderListModel.__init__(self)
self._filter = config.ui.qml.state.episode_list_filter
self._filtered = []
self._processed = []
self._is_subset_view = False

self._config = config
Expand Down Expand Up @@ -864,8 +865,11 @@ def to_dict(episode):
'archive': episode.qarchive,
}

self._root.setEpisodeListModel.emit(map(to_dict,
self._filtered[:EPISODE_LIST_LIMIT]))
processed = map(to_dict, self._filtered[:EPISODE_LIST_LIMIT])
self._root.setEpisodeListModel.emit(processed)

# Keep a reference here to avoid crashes
self._processed = processed

def get_objects(self):
return self._filtered
Expand Down

0 comments on commit bd22025

Please sign in to comment.