List Info

Thread: DO NOT REPLY - MemoryMonitor updates outside of Swing thread




DO NOT REPLY - MemoryMonitor updates outside of Swing thread
user name
2006-11-17 17:55:19
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40
994>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40994





------- Additional Comments From mthomasawarix.com  2006-11-17 09:55 -------
(From update of attachment 19135)
---
sources/org/apache/batik/util/gui/MemoryMonitor.java.orig	20
05-11-07
10:16:40.000000000 -0600
+++ sources/org/apache/batik/util/gui/MemoryMonitor.java   
2006-11-17
11:52:06.000000000 -0600
 -53,6
+53,7 
 import javax.swing.JComponent;
 import javax.swing.JFrame;
 import javax.swing.JPanel;
+import javax.swing.SwingUtilities;

 import org.apache.batik.util.gui.resource.ActionMap;
 import org.apache.batik.util.gui.resource.ButtonFactory;
 -692,12
+693,16 
	for (;;) {
	long free  = runtime.freeMemory();
	long total = runtime.totalMemory();
-	Iterator it = components.iterator();
-	while (it.hasNext()) {
-	    Component c = (Component)it.next();
-	    ((MemoryChangeListener)c).memoryStateChanged(total,
free);
-	    c.repaint();
-	}
+	final Iterator it = components.iterator();
+	 SwingUtilities.invokeLater(new Runnable() {
+	    public void run() {
+		while (it.hasNext()) {
+		    Component c = (Component)it.next();
+		     ((MemoryChangeListener)c).memoryStateChanged(total,
free);
+		    c.repaint();
+		 }
+	     }
+	});
		 try {
		     sleep(timeout);
		     synchronized(this) {


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=ema
il
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the
assignee.

------------------------------------------------------------
---------
To unsubscribe, e-mail: batik-dev-unsubscribexmlgraphics.apache.org
For additional commands, e-mail: batik-dev-helpxmlgraphics.apache.org

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )