サンプル

public class ClassA {

private TextLayout textLayout;

public void makeTextLayout( Device device ) {

textLayout = new TextLayout( device );

if ( !textLayout.isDisposed() ) {
//何らかの処理...
}
}
}



ソリューション
リソース・リークを回避するには、すべての org.eclipse.swt.graphics.TextLayout で dispose() が呼び出されるようにします。



public class ClassA {

private TextLayout textLayout;

public void makeTextLayout( Device device ) {

textLayout = new TextLayout( device );

if ( !textLayout.isDisposed() ) {
//何らかの処理...
}
textLayout.dispose();
}
}