Now BBitmap creates a BWindow in case it can accept views. This avoids a crash in the 'DragMe' sample app.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12870 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stefano Ceccherini 2005-05-28 17:41:24 +00:00
parent 19e4729202
commit e29cd74b0d

View File

@ -777,6 +777,7 @@ BBitmap::BBitmap(const BBitmap *source, bool acceptsViews,
*/
BBitmap::~BBitmap()
{
delete fWindow;
CleanUp();
}
@ -2291,11 +2292,17 @@ BBitmap::InitObject(BRect bounds, color_space colorSpace, uint32 flags,
fToken = -1;
fOrigArea = -1;
}
fInitError = error;
// TODO: on success, handle clearing to white if the flags say so. Needs to be
// dependent on color space.
fInitError = error;
if (fInitError == B_OK) {
if (flags & B_BITMAP_ACCEPTS_VIEWS) {
// TODO: this probably needs to be a special kind of BWindow
fWindow = new BWindow(Bounds(), "offscreen window", B_UNTYPED_WINDOW, 0);
}
}
}
// CleanUp