diff options
author | Martin Kolb <martin.kolb@sap.com> | 2013-04-15 10:20:41 -0400 |
---|---|---|
committer | Grant Gayed <grant_gayed@ca.ibm.com> | 2013-04-15 10:20:41 -0400 |
commit | 61aaa5d345230600c799f6ea9d7e339f868270d4 (patch) | |
tree | 7055b7827c7a8e6e788d4192f417787b374e7ac5 | |
parent | 289663b789c3f5e6763593d701770dc9c6735e45 (diff) | |
download | eclipse.platform.swt-61aaa5d345230600c799f6ea9d7e339f868270d4.tar.gz eclipse.platform.swt-61aaa5d345230600c799f6ea9d7e339f868270d4.tar.xz eclipse.platform.swt-61aaa5d345230600c799f6ea9d7e339f868270d4.zip |
Bug 405711 - Memory Leak / COM Leak in OleEventSink.java and IE.java
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 0e5c23e595..229f9c257b 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 648195eef0..f63d66e607 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; } /** |