Project: SWT
Bug 137911 Browser widgets turn to ghosts if their construction fails.
Reported: 2006-04-21 05:47:19 | Status: resolved fixed

If I instanciate SWT's browser widget on my linux machine where the requirements of this widgets seems not to be fulfiled (i.e. I get an SWTError) there still seems to be something connected with the parent object. To being more specific, I get a "ghost" widget which is taking space like a normal widget. The style used for instantiation is SWT.BORDER. As I don't want to exit the application in this case, but like to provide a fall-back widget, I added a workaround which comprises a auxiliary composite embedding the browser widget only. This auxiliary composite is then disposed on the expection's scope. However, I think the browser should leave the parent object untouched if its instantiation failes.

Files changed in fix:
bundles/org.eclipse.swt/Eclipse SWT Browser/motif/org/eclipse/swt/browser/Browser.java bundles/org.eclipse.swt/Eclipse SWT Mozilla/gtk/org/eclipse/swt/browser/Browser.java