Author: yourpalal Date: 2011-01-07 06:47:39 +0100 (Fri, 07 Jan 2011) New Revision: 40140 Changeset: http://dev.haiku-os.org/changeset/40140 Ticket: http://dev.haiku-os.org/ticket/5841 Modified: haiku/trunk/src/kits/interface/AbstractLayout.cpp Log: 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. Modified: haiku/trunk/src/kits/interface/AbstractLayout.cpp =================================================================== --- haiku/trunk/src/kits/interface/AbstractLayout.cpp 2011-01-07 02:02:44 UTC (rev 40139) +++ haiku/trunk/src/kits/interface/AbstractLayout.cpp 2011-01-07 05:47:39 UTC (rev 40140) @@ -422,18 +422,10 @@ 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); }