We need to dispose of the graphics that we obtain from getDrawGraphics().
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2536 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: FlipFrameManager.java,v 1.2 2003/05/01 22:06:52 mdb Exp $
|
||||
// $Id: FlipFrameManager.java,v 1.3 2003/05/02 23:54:56 mdb Exp $
|
||||
|
||||
package com.threerings.media;
|
||||
|
||||
@@ -35,11 +35,15 @@ public class FlipFrameManager extends FrameManager
|
||||
boolean incremental = true;
|
||||
|
||||
do {
|
||||
Graphics2D gfx = (Graphics2D)_bufstrat.getDrawGraphics();
|
||||
Graphics2D gfx = null;
|
||||
try {
|
||||
gfx = (Graphics2D)_bufstrat.getDrawGraphics();
|
||||
|
||||
// dirty everything if we're not incrementally rendering
|
||||
if (!incremental) {
|
||||
Log.info("Doing non-incremental render; contents lost.");
|
||||
Log.info("Doing non-incremental render; contents lost " +
|
||||
"[lost=" + _bufstrat.contentsLost() +
|
||||
", rest=" + _bufstrat.contentsRestored() + "].");
|
||||
_frame.getRootPane().revalidate();
|
||||
_frame.getRootPane().repaint();
|
||||
}
|
||||
@@ -57,6 +61,11 @@ public class FlipFrameManager extends FrameManager
|
||||
// everything
|
||||
incremental = false;
|
||||
|
||||
} finally {
|
||||
if (gfx != null) {
|
||||
gfx.dispose();
|
||||
}
|
||||
}
|
||||
} while (_bufstrat.contentsLost());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user