summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop
diff options
context:
space:
mode:
authorKevin Barnes <krbarnes>2009-10-21 17:34:00 +0000
committerKevin Barnes <krbarnes>2009-10-21 17:34:00 +0000
commitb0ef4426595eb3f99073c8e7265a99826038f999 (patch)
treef116f939eb9024ed7264d4fbc4fc8b6a62708a3a /bundles/org.eclipse.swt/Eclipse SWT Drag and Drop
parentd8b54f8e5dfbb45b5cd81d430de898ebec507334 (diff)
downloadeclipse.platform.swt-b0ef4426595eb3f99073c8e7265a99826038f999.tar.gz
eclipse.platform.swt-b0ef4426595eb3f99073c8e7265a99826038f999.tar.xz
eclipse.platform.swt-b0ef4426595eb3f99073c8e7265a99826038f999.zip
290568 - [DND] JVM crash with "Invalid memory access" after calling dispose() in dragFinished()
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT Drag and Drop')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/DragSource.java25
1 files changed, 15 insertions, 10 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/DragSource.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/DragSource.java
index 9b83ecb748..fb89ff894b 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/DragSource.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/DragSource.java
@@ -434,16 +434,21 @@ void draggedImage_endedAt_operation(int /*long*/ id, int /*long*/ sel, int /*lon
paths = null;
exist = null;
}
- Event event = new DNDEvent();
- event.widget = this;
- event.time = (int)System.currentTimeMillis();
- event.doit = swtOperation != DND.DROP_NONE;
- event.detail = swtOperation;
- notifyListeners(DND.DragEnd, event);
- dragImageFromListener = null;
-
- if (new NSObject(id).isKindOfClass(OS.class_NSTableView)) {
- callSuper(id, sel, arg0, arg1, arg2);
+ OS.objc_msgSend(id, OS.sel_retain);
+ try {
+ Event event = new DNDEvent();
+ event.widget = this;
+ event.time = (int)System.currentTimeMillis();
+ event.doit = swtOperation != DND.DROP_NONE;
+ event.detail = swtOperation;
+ notifyListeners(DND.DragEnd, event);
+ dragImageFromListener = null;
+
+ if (new NSObject(id).isKindOfClass(OS.class_NSTableView)) {
+ callSuper(id, sel, arg0, arg1, arg2);
+ }
+ } finally {
+ OS.objc_msgSend(id, OS.sel_release);
}
}