Call ReleaseReference when a BReference is not needed

Reduces complexity and is actualñly more readable.
This commit is contained in:
Adrien Destugues
2015-01-23 14:57:23 +01:00
parent 6f3acb9163
commit 8bcd69044c
4 changed files with 7 additions and 5 deletions
@@ -56,7 +56,7 @@ BitmapDrawingEngine::SetSize(int32 newWidth, int32 newHeight)
fHWInterface = NULL;
}
fBitmap.Unset();
fBitmap->ReleaseReference();
if (newWidth <= 0 || newHeight <= 0)
return B_OK;
@@ -25,7 +25,7 @@ virtual ~BitmapDrawingEngine();
private:
color_space fColorSpace;
BitmapHWInterface* fHWInterface;
BReference<UtilityBitmap> fBitmap;
UtilityBitmap* fBitmap;
BRegion fClipping;
};
+3 -1
View File
@@ -791,7 +791,7 @@ Tab::CompareFunction(const Tab* tab1, const Tab* tab2)
SATGroup::SATGroup()
:
fLinearSpec(new(std::nothrow) LinearSpec(), true),
fLinearSpec(new(std::nothrow) LinearSpec()),
fHorizontalTabsSorted(false),
fVerticalTabsSorted(false),
fActiveWindow(NULL)
@@ -806,6 +806,8 @@ SATGroup::~SATGroup()
debugger("Deleting a SATGroup which is not empty");
//while (fSATWindowList.CountItems() > 0)
// RemoveWindow(fSATWindowList.ItemAt(0));
fLinearSpec->ReleaseReference();
}
+2 -2
View File
@@ -244,7 +244,7 @@ public:
SATGroup();
~SATGroup();
LinearSpec* GetLinearSpec() { return fLinearSpec.Get(); }
LinearSpec* GetLinearSpec() { return fLinearSpec; }
/*! Create a new WindowArea from the crossing and add the window. */
bool AddWindow(SATWindow* window, Tab* left,
@@ -321,7 +321,7 @@ protected:
WindowAreaList fWindowAreaList;
SATWindowList fSATWindowList;
BReference<LinearSpec> fLinearSpec;
LinearSpec* fLinearSpec;
private:
TabList fHorizontalTabs;