diff options
-rw-r--r-- | libjava/ChangeLog | 5 | ||||
-rw-r--r-- | libjava/java/awt/Component.java | 33 |
2 files changed, 25 insertions, 13 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 58e2b8a..7d4b1a5 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,8 @@ +2003-01-28 Oscar Pearce <oscar@pearceenterprises.com> + + * java/awt/Component.java (processPaintEvent): Dispose of Graphics + object when finished. + 2003-01-28 Andreas Tobler <a.tobler@schweiz.ch> * libjava/configure.host: Disable can_unwind_signal on darwin. diff --git a/libjava/java/awt/Component.java b/libjava/java/awt/Component.java index fd03911..d61db05 100644 --- a/libjava/java/awt/Component.java +++ b/libjava/java/awt/Component.java @@ -1,5 +1,5 @@ /* Component.java -- a graphics component - Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation + Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation This file is part of GNU Classpath. @@ -4168,19 +4168,26 @@ p * <li>the set of backward traversal keys return; Graphics gfx = getGraphics(); - Shape clip = event.getUpdateRect(); - gfx.setClip(clip); - - switch (event.id) + try { - case PaintEvent.PAINT: - paint(gfx); - break; - case PaintEvent.UPDATE: - update(gfx); - break; - default: - throw new IllegalArgumentException("unknown paint event"); + Shape clip = event.getUpdateRect(); + gfx.setClip(clip); + + switch (event.id) + { + case PaintEvent.PAINT: + paint(gfx); + break; + case PaintEvent.UPDATE: + update(gfx); + break; + default: + throw new IllegalArgumentException("unknown paint event"); + } + } + finally + { + gfx.dispose(); } } |