javauis/eswt_qt/org.eclipse.swt/Eclipse SWT/qt/org/eclipse/swt/graphics/GC.java
changeset 35 85266cc22c7f
parent 21 2a9601315dfc
child 72 1f0034e370aa
--- a/javauis/eswt_qt/org.eclipse.swt/Eclipse SWT/qt/org/eclipse/swt/graphics/GC.java	Thu May 27 12:49:31 2010 +0300
+++ b/javauis/eswt_qt/org.eclipse.swt/Eclipse SWT/qt/org/eclipse/swt/graphics/GC.java	Fri Jun 11 13:33:44 2010 +0300
@@ -322,9 +322,12 @@
  *                that created the drawable</li>
  */
 public void dispose() {
+	final Display display = (Display)data.device; 
+	if(display.getThread() != Thread.currentThread()) {
+		SWT.error(SWT.ERROR_THREAD_INVALID_ACCESS);
+	}
     if (drawable != null && handle != 0) {
         if (data.buffered && (drawable instanceof Control)) {
-            final Display display = Display.getDefault();
             display.syncExec(new Runnable() {
                 public void run() {
                     ((Control) drawable).redraw();