Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 480816 - [Cocoa] Tree.cellSize throws NPE while Display.sleep()
Summary: [Cocoa] Tree.cellSize throws NPE while Display.sleep()
Status: CLOSED DUPLICATE of bug 434393
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.5.1   Edit
Hardware: PC Mac OS X
: P3 critical (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-27 16:45 EDT by Eyck Jentzsch CLA
Modified: 2015-10-28 03:28 EDT (History)
1 user (show)

See Also:


Attachments
Stacktrace of the NPE (3.22 KB, text/plain)
2015-10-27 16:45 EDT, Eyck Jentzsch CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eyck Jentzsch CLA 2015-10-27 16:45:43 EDT
Created attachment 257570 [details]
Stacktrace of the NPE

Hi,
I'm developing an E4 based application using TreeViewer with multiple columns. When PartRenderingEngine runs eventLoopIdle a NullPointerException is thrown. This happens frequently resulting in an nasty error message dialog.

Root cause is that Control.internal_new_GC() does not check if the graphicsContext is valid:

	NSGraphicsContext graphicsContext = NSGraphicsContext.currentContext();
	context = graphicsContext.id;

but NSGraphicsContext.currentContext() may return null:

	public static NSGraphicsContext currentContext() {
		long /*int*/ result = OS.objc_msgSend(OS.class_NSGraphicsContext, OS.sel_currentContext);
		return result != 0 ? new NSGraphicsContext(result) : null;
	}

Attached is a stacktrace, bundle is org.eclipse.swt.cocoa.macosx.x86_64_3.104.1.v20150825-0743.jar
Comment 1 Arun Thondapu CLA 2015-10-28 03:28:24 EDT

*** This bug has been marked as a duplicate of bug 434393 ***