mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 14:42:11 +02:00
Avoid NPE and redrawing disposed widget
Contributed by STMicroelectronics Change-Id: I753844ff035bc6b3511c1e283e80e37bd547b6e7 Signed-off-by: Torbjörn Svensson <torbjorn.svensson@st.com>
This commit is contained in:
parent
bc8c94fbe6
commit
c5f0f85be0
1 changed files with 7 additions and 1 deletions
|
@ -46,6 +46,7 @@ import org.eclipse.jface.text.IDocument;
|
|||
import org.eclipse.jface.text.IDocumentPartitioner;
|
||||
import org.eclipse.jface.util.IPropertyChangeListener;
|
||||
import org.eclipse.jface.util.PropertyChangeEvent;
|
||||
import org.eclipse.swt.custom.StyledText;
|
||||
import org.eclipse.swt.graphics.Color;
|
||||
import org.eclipse.swt.graphics.RGB;
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
|
@ -409,7 +410,12 @@ public class BuildConsoleManager implements IBuildConsoleManager, IResourceChang
|
|||
if (v == null)
|
||||
return;
|
||||
Display display = Display.getDefault();
|
||||
display.asyncExec(() -> v.getTextWidget().redraw());
|
||||
display.asyncExec(() -> {
|
||||
StyledText widget = v.getTextWidget();
|
||||
if (widget != null && !widget.isDisposed()) {
|
||||
widget.redraw();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public IBuildConsoleStreamDecorator getStreamDecorator(int type) throws CoreException {
|
||||
|
|
Loading…
Add table
Reference in a new issue