equal
deleted
inserted
replaced
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 ; |