Ejemplo
public class
ClassA {
private
TextLayout textLayout;
public void
makeTextLayout( Device device ) {
textLayout =
new
TextLayout( device );
if ( !textLayout.isDisposed() ) {
//realice alguna operación...
}
}
}
Solución
Para evitar pérdidas de recursos, asegúrese de que se invoque dispose() en cada org.eclipse.swt.graphics.TextLayout.
public class
ClassA {
private
TextLayout textLayout;
public void
makeTextLayout( Device device ) {
textLayout =
new
TextLayout( device );
if ( !textLayout.isDisposed() ) {
//realice alguna operación...
}
textLayout.dispose();
}
}