* Moved child creation to the constructor; it doesn't seem to have any negative

effect, and DetachedFromWindow() was not symmetrical to AttachedToWindow(),
  and would have leaked the children if called without destroying inbetween.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36888 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2010-05-21 21:47:57 +00:00
parent 77cb5459be
commit 0dd68c866c

View File

@ -86,6 +86,11 @@ TBarView::TBarView(BRect frame, bool vertical, bool left, bool top,
fMaxRecentApps(kDefaultRecentAppCount),
fLastDragItem(NULL)
{
fReplicantTray = new TReplicantTray(this, fVertical);
fDragRegion = new TDragRegion(this, fReplicantTray);
fDragRegion->AddChild(fReplicantTray);
if (fTrayLocation != 0)
AddChild(fDragRegion);
}
@ -104,12 +109,6 @@ TBarView::AttachedToWindow()
SetViewColor(ui_color(B_MENU_BACKGROUND_COLOR));
SetFont(be_plain_font);
fReplicantTray = new TReplicantTray(this, fVertical);
fDragRegion = new TDragRegion(this, fReplicantTray);
fDragRegion->AddChild(fReplicantTray);
if (fTrayLocation != 0)
AddChild(fDragRegion);
UpdateAutoRaise();
UpdatePlacement();
@ -576,6 +575,7 @@ TBarView::ShowingClock() const
// #pragma mark - Drag and Drop
void
TBarView::CacheDragData(const BMessage* incoming)
{