summaryrefslogtreecommitdiff
diff options
authorMichal Hruby <michal.mhr@gmail.com>2012-08-13 09:30:40 +0200
committerMichal Hruby <michal.mhr@gmail.com>2012-08-13 09:30:40 +0200
commit67188281f5098fc91fb78753eeb766290a59c85c (patch)
tree9f50648795e70bf5c20c14c1ba7e39ae48f515f6
parentf96ef373fd252b5a7f4bcc94d229b21f225795cb (diff)
Fix criticals coming from ResultView's destructor
(bzr r2547.3.4)
-rw-r--r--dash/LensView.cpp5
-rw-r--r--dash/ResultView.cpp9
2 files changed, 8 insertions, 6 deletions
diff --git a/dash/LensView.cpp b/dash/LensView.cpp
index baa23bdf9..2d0acfcf0 100644
--- a/dash/LensView.cpp
+++ b/dash/LensView.cpp
@@ -279,6 +279,8 @@ void LensView::OnCategoryAdded(Category const& category)
<< ", " << renderer_name
<< ", " << boost::lexical_cast<int>(index) << ")";
+ // FIXME: duplicating PlacesGroups when lens crashes and restarts!
+
PlacesGroup* group = new PlacesGroup();
AddChild(group);
group->SetName(name);
@@ -320,6 +322,9 @@ void LensView::OnCategoryAdded(Category const& category)
if (reset_filter_models)
{
+ /* HomeLens is reodering the categories, and since their index is based
+ * on the row position in the model, we need to re-initialize the filter
+ * models if we got insert and not an append */
for (auto it = categories_.begin() + (index + 1); it != categories_.end(); ++it)
{
grid = static_cast<ResultViewGrid*>((*it)->GetChildView());
diff --git a/dash/ResultView.cpp b/dash/ResultView.cpp
index 6dd5d5d9d..88f959337 100644
--- a/dash/ResultView.cpp
+++ b/dash/ResultView.cpp
@@ -56,13 +56,10 @@ ResultView::~ResultView()
{
ClearIntrospectableWrappers();
- if (result_model_)
+ for (ResultIterator iter(GetIteratorAtRow(0)); !iter.IsLast(); ++iter)
{
- for (ResultIterator iter(result_model_); !iter.IsLast(); ++iter)
- {
- Result result(*iter);
- renderer_->Unload(result);
- }
+ Result result(*iter);
+ renderer_->Unload(result);
}
renderer_->UnReference();