Revision: 1087
Author: heuermh
Date: Tue Dec 21 11:53:44 2010
Log: Issue 185 ; applying patch issue185fix.patch
http://code.google.com/p/piccolo2d/source/detail?r=1087
Modified:
/piccolo2d.java/branches/release-1.3/core/src/main/java/edu/umd/cs/piccolo/activities/PActivityScheduler.java
/piccolo2d.java/branches/release-1.3/examples/src/main/java/edu/umd/cs/piccolo/examples/ActivityMemoryLeakBugExample.java
=======================================
---
/piccolo2d.java/branches/release-1.3/core/src/main/java/edu/umd/cs/piccolo/activities/PActivityScheduler.java
Fri Aug 6 08:50:49 2010
+++
/piccolo2d.java/branches/release-1.3/core/src/main/java/edu/umd/cs/piccolo/activities/PActivityScheduler.java
Tue Dec 21 11:53:44 2010
@@ -169,7 +169,6 @@
public void processActivities(final long currentTime) {
final int size = activities.size();
if (size > 0) {
- processingActivities.clear();
processingActivities.addAll(activities);
for (int i = size - 1; i >= 0; i--) {
final PActivity each = (PActivity)
processingActivities.get(i);
=======================================
---
/piccolo2d.java/branches/release-1.3/examples/src/main/java/edu/umd/cs/piccolo/examples/ActivityMemoryLeakBugExample.java
Fri Aug 6 08:50:49 2010
+++
/piccolo2d.java/branches/release-1.3/examples/src/main/java/edu/umd/cs/piccolo/examples/ActivityMemoryLeakBugExample.java
Tue Dec 21 11:53:44 2010
@@ -91,14 +91,17 @@
// empty
}
- PActivity a = new PActivity(-1) {
- /** {...@inheritdoc} */
- protected void activityStep(final long
elapsedTime) {
- System.out.println("cleanup activity");
- terminate();
- }
- };
- layer.getRoot().addActivity(a);
+ SwingUtilities.invokeLater(new Runnable() {
+ public void run() {
+ PActivity a = new PActivity(-1) {
+ protected void activityStep(final long
elapsedTime) {
+ System.out.println("cleanup
activity");
+ terminate();
+ }
+ };
+ layer.getRoot().addActivity(a);
+ }
+ });
}
}.start();
}
--
Piccolo2D Developers Group: http://groups.google.com/group/piccolo2d-dev?hl=en