Skip to content

Commit 0670f02

Browse files
author
ztenghui
committed
VD: Fix Canvas save leak
bug:16965998 Change-Id: I367388b270748e2ce114b468940966d78de07465
1 parent 1fbc124 commit 0670f02

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

graphics/java/android/graphics/drawable/VectorDrawable.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,14 +238,13 @@ public ConstantState getConstantState() {
238238

239239
@Override
240240
public void draw(Canvas canvas) {
241-
final int saveCount = canvas.save();
242241
final Rect bounds = getBounds();
243-
244242
if (bounds.width() == 0 || bounds.height() == 0) {
245243
// too small to draw
246244
return;
247245
}
248246

247+
final int saveCount = canvas.save();
249248
final boolean needMirroring = needMirroring();
250249

251250
canvas.translate(bounds.left, bounds.top);

0 commit comments

Comments
 (0)