fix memory leak

This commit is contained in:
Jindřich Makovička 2012-05-12 12:16:42 +02:00
parent 078d11c324
commit 036e9e0b82

View file

@ -248,21 +248,25 @@ void drawOneWayPaints(RenderingContext* rc, SkCanvas* cv, SkPath* p) {
p->setStrokeWidth(1); p->setStrokeWidth(1);
p->setPathEffect(arrowDashEffect1)->unref(); p->setPathEffect(arrowDashEffect1)->unref();
oneWayPaints.push_back(*p); oneWayPaints.push_back(*p);
delete p;
p = oneWayPaint(); p = oneWayPaint();
p->setStrokeWidth(2); p->setStrokeWidth(2);
p->setPathEffect(arrowDashEffect2)->unref(); p->setPathEffect(arrowDashEffect2)->unref();
oneWayPaints.push_back(*p); oneWayPaints.push_back(*p);
delete p;
p = oneWayPaint(); p = oneWayPaint();
p->setStrokeWidth(3); p->setStrokeWidth(3);
p->setPathEffect(arrowDashEffect3)->unref(); p->setPathEffect(arrowDashEffect3)->unref();
oneWayPaints.push_back(*p); oneWayPaints.push_back(*p);
delete p;
p = oneWayPaint(); p = oneWayPaint();
p->setStrokeWidth(4); p->setStrokeWidth(4);
p->setPathEffect(arrowDashEffect4)->unref(); p->setPathEffect(arrowDashEffect4)->unref();
oneWayPaints.push_back(*p); oneWayPaints.push_back(*p);
delete p;
} }
for (size_t i = 0; i < oneWayPaints.size(); i++) { for (size_t i = 0; i < oneWayPaints.size(); i++) {