BColorControl: Remove fOffscreenView pointer

...and rename fBitmap to fOffscreenBitmap to make it more clear what it is.

We don't need to save a pointer to both the offscreen bitmap and
the offscreen view, just the bitmap. We can access the view by calling
fOffscreenBitmap->ChildAt((int32)0). This gives us back a _reserved private
variable slot.

In the (unlikely) case that _InitData() is called with offscreen = false but
the fOffscreenBitmap is not NULL, delete fOffscreenBitmap before
setting it to NULL so that memory is not leaked.
This commit is contained in:
John Scipione
2016-03-12 19:14:26 -08:00
parent 76b9d53bd0
commit 53f75ce5d6
2 changed files with 25 additions and 25 deletions
+2 -3
View File
@@ -125,12 +125,11 @@ private:
BTextControl* fGreenText;
BTextControl* fBlueText;
BBitmap* fBitmap;
BView* fOffscreenView;
BBitmap* fOffscreenBitmap;
int16 fFocusedRamp;
int16 fClickedRamp;
uint32 _reserved[2];
uint32 _reserved[3];
};
inline void