Esempio

public class ClassA {

private Path path;

public void makePath( Device device ) {

path = new Path( device );

if ( !path.isDisposed() ) {
//eseguire un'operazione...
}
}
}



Soluzione
Per evitare perdite di risorse, verificare che dispose() venga richiamato su ogni org.eclipse.swt.graphics.Path.



public class ClassA {

private Path path;

public void makePath( Device device ) {

path = new Path( device );

if ( !path.isDisposed() ) {
//eseguire un'operazione...
}
path.dispose();
}
}