Przykład

public class ClassA {

private Shell shell;

public void makeShell( ) {

shell = new Shell( );

if ( !shell.isDisposed() ) {
//inne operacje...
}
}
}



Rozwiązanie
Aby uniknąć przecieków zasobów, upewnij się, że dla każdej klasy org.eclipse.swt.widgets.Shell jest wywoływana metoda dispose().
Uwaga: ta reguła ma zastosowanie do dowolnej postaci konstruktora Shell.


public class ClassA {

private Shell shell;

public void makeShell( ) {

shell = new Shell( );

if ( !shell.isDisposed() ) {
//inne operacje...
}
shell.dispose();
}
}