In fixing CID #5841, I found that not only does the code in BAbstractLayout::AllUnarchived() leak, it is also mostly unnecessary! (mea culpa) This fixes both problems.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40140 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Alex Wilson
2011-01-07 05:47:39 +00:00
parent 0ee86c8d2f
commit d3e72a992d
+4 -12
View File
@@ -422,18 +422,10 @@ BAbstractLayout::Archive(BMessage* into, bool deep) const
status_t status_t
BAbstractLayout::AllUnarchived(const BMessage* from) BAbstractLayout::AllUnarchived(const BMessage* from)
{ {
if (Owner()) { status_t err = fExplicitData->RestoreDataFromArchive(from);
ViewProxy* proxy = dynamic_cast<ViewProxy*>(fExplicitData); if (err != B_OK)
if (!proxy) { return err;
delete fExplicitData;
proxy = new ViewProxy(Owner());
}
proxy->view = Owner();
} else {
fExplicitData = new DataProxy();
return fExplicitData->RestoreDataFromArchive(from);
}
return BLayout::AllUnarchived(from); return BLayout::AllUnarchived(from);
} }