From caadca918216c9e5106b7e9e7bee268f675540b0 Mon Sep 17 00:00:00 2001 From: Stefano Ceccherini Date: Sun, 6 Dec 2009 10:41:03 +0000 Subject: [PATCH] Also delete the BScrollBar we detach from the BScrollView. Even if it was detached, it was still scrolling the view, causing bug #5077. Moreover we were leaking it. Also call TargetedByScrollBar on the "old" target with a NULL parameter, and on the new target, with "this". git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34516 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/terminal/TermScrollView.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/apps/terminal/TermScrollView.cpp b/src/apps/terminal/TermScrollView.cpp index 9e4150d0a7..7d73ca547b 100644 --- a/src/apps/terminal/TermScrollView.cpp +++ b/src/apps/terminal/TermScrollView.cpp @@ -37,10 +37,13 @@ TermScrollView::TermScrollView(const char* name, BView* child, BView* target, : BScrollView(name, child, resizingMode, 0, false, true, B_NO_BORDER) { + child->TargetedByScrollView(NULL); + // replace the vertical scroll bar with our own if (fVerticalScrollBar != NULL) { BRect frame(fVerticalScrollBar->Frame()); RemoveChild(fVerticalScrollBar); + delete fVerticalScrollBar; // Overlap one pixel at the top (if required) and the bottom of the // scroll bar with the menu respectively resize knob for aesthetical @@ -54,6 +57,8 @@ TermScrollView::TermScrollView(const char* name, BView* child, BView* target, AddChild(scrollBar); fVerticalScrollBar = scrollBar; } + + target->TargetedByScrollView(this); }