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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user