Use a tab BReference as argument in Area::Set{Left, Top, Right, Bottom}.
Using a normal pointer is dangerous when creating a new tab directly in the method call because the tab gets deleted to early.
This commit is contained in:
@@ -56,10 +56,10 @@ public:
|
|||||||
XTab* Right() const;
|
XTab* Right() const;
|
||||||
YTab* Top() const;
|
YTab* Top() const;
|
||||||
YTab* Bottom() const;
|
YTab* Bottom() const;
|
||||||
void SetLeft(XTab* left);
|
void SetLeft(BReference<XTab> left);
|
||||||
void SetRight(XTab* right);
|
void SetRight(BReference<XTab> right);
|
||||||
void SetTop(YTab* top);
|
void SetTop(BReference<YTab> top);
|
||||||
void SetBottom(YTab* bottom);
|
void SetBottom(BReference<YTab> bottom);
|
||||||
|
|
||||||
Row* GetRow() const;
|
Row* GetRow() const;
|
||||||
Column* GetColumn() const;
|
Column* GetColumn() const;
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ Area::Bottom() const
|
|||||||
* @param left the left tab of the area
|
* @param left the left tab of the area
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
Area::SetLeft(XTab* left)
|
Area::SetLeft(BReference<XTab> left)
|
||||||
{
|
{
|
||||||
fLeft = left;
|
fLeft = left;
|
||||||
|
|
||||||
@@ -97,7 +97,7 @@ Area::SetLeft(XTab* left)
|
|||||||
* @param right the right tab of the area
|
* @param right the right tab of the area
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
Area::SetRight(XTab* right)
|
Area::SetRight(BReference<XTab> right)
|
||||||
{
|
{
|
||||||
fRight = right;
|
fRight = right;
|
||||||
|
|
||||||
@@ -114,7 +114,7 @@ Area::SetRight(XTab* right)
|
|||||||
* Sets the top tab of the area.
|
* Sets the top tab of the area.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
Area::SetTop(YTab* top)
|
Area::SetTop(BReference<YTab> top)
|
||||||
{
|
{
|
||||||
fTop = top;
|
fTop = top;
|
||||||
|
|
||||||
@@ -131,7 +131,7 @@ Area::SetTop(YTab* top)
|
|||||||
* Sets the bottom tab of the area.
|
* Sets the bottom tab of the area.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
Area::SetBottom(YTab* bottom)
|
Area::SetBottom(BReference<YTab> bottom)
|
||||||
{
|
{
|
||||||
fBottom = bottom;
|
fBottom = bottom;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user