aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Kolb2013-04-15 10:20:41 (EDT)
committerGrant Gayed2013-04-15 10:20:41 (EDT)
commit61aaa5d345230600c799f6ea9d7e339f868270d4 (patch)
tree7055b7827c7a8e6e788d4192f417787b374e7ac5
parent289663b789c3f5e6763593d701770dc9c6735e45 (diff)
downloadeclipse.platform.swt-61aaa5d345230600c799f6ea9d7e339f868270d4.zip
eclipse.platform.swt-61aaa5d345230600c799f6ea9d7e339f868270d4.tar.gz
eclipse.platform.swt-61aaa5d345230600c799f6ea9d7e339f868270d4.tar.bz2
Bug 405711 - Memory Leak / COM Leak in OleEventSink.java and IE.java
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Browser/win32/org/eclipse/swt/browser/IE.java12
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleEventSink.java9
2 files changed, 12 insertions, 9 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Browser/win32/org/eclipse/swt/browser/IE.java b/bundles/org.eclipse.swt/Eclipse SWT Browser/win32/org/eclipse/swt/browser/IE.java
index 0e5c23e..229f9c2 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Browser/win32/org/eclipse/swt/browser/IE.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Browser/win32/org/eclipse/swt/browser/IE.java
@@ -997,13 +997,6 @@ public void create(Composite parent, int style) {
}
}
}
- /*
- * Dispose all arguments passed in the OleEvent. This must be
- * done to properly release any IDispatch reference that was
- * automatically addRef'ed when constructing the OleEvent.
- */
- Variant[] arguments = event.arguments;
- for (int i = 0; i < arguments.length; i++) arguments[i].dispose();
}
};
site.addEventListener(BeforeNavigate2, oleListener);
@@ -1870,7 +1863,10 @@ void handleDOMEvent (OleEvent e) {
* Feature in IE. Spurious and redundant mousemove events are often received. The workaround
* is to not fire MouseMove events whose x and y values match the last MouseMove.
*/
- if (newEvent.x == lastMouseMoveX && newEvent.y == lastMouseMoveY) return;
+ if (newEvent.x == lastMouseMoveX && newEvent.y == lastMouseMoveY) {
+ event.dispose();
+ return;
+ }
newEvent.type = SWT.MouseMove;
lastMouseMoveX = newEvent.x; lastMouseMoveY = newEvent.y;
} else if (eventType.equals(EVENT_MOUSEOVER)) {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleEventSink.java b/bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleEventSink.java
index 648195e..f63d66e 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleEventSink.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleEventSink.java
@@ -114,10 +114,17 @@ private int Invoke(int dispIdMember, long /*int*/ riid, int lcid, int dwFlags, l
offset = offset - size;
}
}
-
+
OleEvent event = new OleEvent();
event.arguments = eventInfo;
notifyListener(dispIdMember,event);
+
+ if (eventInfo != null) {
+ for (int j = 0; j < eventInfo.length; j++){
+ eventInfo[j].dispose();
+ }
+ }
+
return COM.S_OK;
}
/**