classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cp-patches] [patch] fix memory image source handling in GTK peers


From: Mark Wielaard
Subject: Re: [cp-patches] [patch] fix memory image source handling in GTK peers
Date: Tue, 26 Jul 2005 07:48:22 +0200

Hi,

On Mon, 2005-07-25 at 21:56 -0400, Thomas Fitzsimmons wrote:

> @@ -372,8 +374,28 @@
>      if (x == 0 && y == 0 && width == 0 && height == 0)
>        return;
>  
> -    q().postEvent (new PaintEvent (awtComponent, PaintEvent.UPDATE,
> -                                 new Rectangle (x, y, width,
> height)));
> +    Timer t = new Timer();
> +
> +    t.schedule(new RepaintTimerTask(x, y, width, height), tm);
> +  }

I don't think you want to create a (non-daemon) Timer each and every
time here. That means that on each repaint() a new Thread is created
which is never destroyed and which will prevent the application to ever
stop since the Timers will be live. Try to either create a reusable
(daemon) Timer that is used for all repaints. And/Or add a TimerTask to
cancel the Timer after it hasn't been used for a while.

Cheers,

Mark

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]