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
1 changed files with 4 additions and 12 deletions

View File

@ -422,17 +422,9 @@ BAbstractLayout::Archive(BMessage* into, bool deep) const
status_t
BAbstractLayout::AllUnarchived(const BMessage* from)
{
if (Owner()) {
ViewProxy* proxy = dynamic_cast<ViewProxy*>(fExplicitData);
if (!proxy) {
delete fExplicitData;
proxy = new ViewProxy(Owner());
}
proxy->view = Owner();
} else {
fExplicitData = new DataProxy();
return fExplicitData->RestoreDataFromArchive(from);
}
status_t err = fExplicitData->RestoreDataFromArchive(from);
if (err != B_OK)
return err;
return BLayout::AllUnarchived(from);
}