summaryrefslogtreecommitdiffstats
path: root/examples/opengl/qopenglwidget/bubble.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/opengl/qopenglwidget/bubble.cpp')
-rw-r--r--examples/opengl/qopenglwidget/bubble.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/examples/opengl/qopenglwidget/bubble.cpp b/examples/opengl/qopenglwidget/bubble.cpp
index dbaf460f6f..7e69aac3e7 100644
--- a/examples/opengl/qopenglwidget/bubble.cpp
+++ b/examples/opengl/qopenglwidget/bubble.cpp
@@ -57,15 +57,13 @@ Bubble::Bubble(const QPointF &position, qreal radius, const QPointF &velocity)
{
innerColor = randomColor();
outerColor = randomColor();
- cache = 0;
updateBrush();
}
//! [0]
void Bubble::updateCache()
{
- if (cache)
- delete cache;
+ delete cache;
cache = new QImage(qRound(radius * 2 + 2), qRound(radius * 2 + 2), QImage::Format_ARGB32_Premultiplied);
cache->fill(0x00000000);
QPainter p(cache);
@@ -80,8 +78,7 @@ void Bubble::updateCache()
Bubble::~Bubble()
{
- if (cache)
- delete cache;
+ delete cache;
}
void Bubble::updateBrush()