javauis/eswt_qt/org.eclipse.swt/Eclipse SWT/qt/org/eclipse/swt/graphics/GC.java
changeset 35 85266cc22c7f
parent 21 2a9601315dfc
child 72 1f0034e370aa
equal deleted inserted replaced
26:dc7c549001d5 35:85266cc22c7f
   320  *                <ul>
   320  *                <ul>
   321  *                <li>ERROR_THREAD_INVALID_ACCESS if not called from the thread
   321  *                <li>ERROR_THREAD_INVALID_ACCESS if not called from the thread
   322  *                that created the drawable</li>
   322  *                that created the drawable</li>
   323  */
   323  */
   324 public void dispose() {
   324 public void dispose() {
       
   325 	final Display display = (Display)data.device; 
       
   326 	if(display.getThread() != Thread.currentThread()) {
       
   327 		SWT.error(SWT.ERROR_THREAD_INVALID_ACCESS);
       
   328 	}
   325     if (drawable != null && handle != 0) {
   329     if (drawable != null && handle != 0) {
   326         if (data.buffered && (drawable instanceof Control)) {
   330         if (data.buffered && (drawable instanceof Control)) {
   327             final Display display = Display.getDefault();
       
   328             display.syncExec(new Runnable() {
   331             display.syncExec(new Runnable() {
   329                 public void run() {
   332                 public void run() {
   330                     ((Control) drawable).redraw();
   333                     ((Control) drawable).redraw();
   331                     while (display.readAndDispatch())
   334                     while (display.readAndDispatch())
   332                         ;
   335                         ;