aboutsummaryrefslogtreecommitdiff
path: root/libjava/gnu/gcj/xlib/natClip.cc
diff options
context:
space:
mode:
authorScott Gilbertson <scottg@mantatest.com>2003-04-19 19:54:39 +0000
committerTom Tromey <tromey@gcc.gnu.org>2003-04-19 19:54:39 +0000
commit9e9e204234b883d783914aa909e96c57d45ac081 (patch)
tree904af78e7c2b08b109cc574a36927a487d9db2f5 /libjava/gnu/gcj/xlib/natClip.cc
parentafd4910af1eeaa5bd13bed450d81761e6fb5bcca (diff)
downloadgcc-9e9e204234b883d783914aa909e96c57d45ac081.zip
gcc-9e9e204234b883d783914aa909e96c57d45ac081.tar.gz
gcc-9e9e204234b883d783914aa909e96c57d45ac081.tar.bz2
XGraphics.java (XGraphics): Use new GC.create.
2003-04-19 Scott Gilbertson <scottg@mantatest.com> * gnu/awt/xlib/XGraphics.java (XGraphics): Use new GC.create. (dispose): Null metrics. * gnu/awt/xlib/XToolkit.java (sync): Implement. * gnu/gcj/xlib/Clip.java (dispose): Change name of native from finalize. (finalize): Call dispose. * gnu/gcj/xlib/Drawable.java (gcCache): New field. (gcCachedCount): New field. (finalize): New method. (putGCInCache): New method. (getGCFromCache): New method. * gnu/gcj/xlib/GC.java (GC): Make protected. (clone): Get new GC from cache if possible. (create): New static method. (dispose): Save old GC in cache. * gnu/gcj/xlib/natClip.cc (dispose): Check for null before deleting. * gnu/gcj/xlib/natGC.cc (initStructure): Call XCreateGC only if gc is null. * gnu/gcj/xlib/Pixmap.java (Pixmap): Use new GC.create. * java/awt/Container.java (visitChild): Dispose gfx2 when finished. From-SVN: r65827
Diffstat (limited to 'libjava/gnu/gcj/xlib/natClip.cc')
-rw-r--r--libjava/gnu/gcj/xlib/natClip.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/libjava/gnu/gcj/xlib/natClip.cc b/libjava/gnu/gcj/xlib/natClip.cc
index 51426c8..a1f626d 100644
--- a/libjava/gnu/gcj/xlib/natClip.cc
+++ b/libjava/gnu/gcj/xlib/natClip.cc
@@ -46,7 +46,11 @@ void gnu::gcj::xlib::Clip::init(AWTRectArray* rectangles)
xrects = reinterpret_cast<gnu::gcj::RawData*>(xrectvector);
}
-void gnu::gcj::xlib::Clip::finalize()
+void gnu::gcj::xlib::Clip::dispose()
{
- delete xrects; xrects = 0;
+ if (xrects)
+ {
+ delete xrects;
+ xrects = 0;
+ }
}