Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGrant Gayed2009-12-15 17:32:25 +0000
committerGrant Gayed2009-12-15 17:32:25 +0000
commit89e14c9470194d348eb7e11717c461cadb87fc47 (patch)
tree136af6a29657b99249511678e7e77d1832f63b8b /bundles/org.eclipse.swt/Eclipse SWT OLE Win32
parentbc9ce4c19e095afd41a7f0bb329d358c89dcca3e (diff)
downloadeclipse.platform.swt-89e14c9470194d348eb7e11717c461cadb87fc47.tar.gz
eclipse.platform.swt-89e14c9470194d348eb7e11717c461cadb87fc47.tar.xz
eclipse.platform.swt-89e14c9470194d348eb7e11717c461cadb87fc47.zip
295185 - Refresh of PDF in SWT browser leads to jvm crash
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT OLE Win32')
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleClientSite.java23
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleFrame.java4
2 files changed, 17 insertions, 10 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleClientSite.java b/bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleClientSite.java
index c5995e91ad..09fd10d214 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleClientSite.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleClientSite.java
@@ -79,6 +79,7 @@ public class OleClientSite extends Composite {
private int type; // Indicates the type of client that can be supported inside this container
private boolean isStatic; // Indicates item's display is static, i.e., a bitmap, metafile, etc.
boolean isActivated;
+ private int token;
private RECT borderWidths = new RECT();
private RECT indent = new RECT();
@@ -439,6 +440,7 @@ protected void addObjectReferences() {
}
int[] pdwConnection = new int[1];
objIOleObject.Advise(iAdviseSink.getAddress(), pdwConnection);
+ token = pdwConnection[0];
objIOleObject.SetHostNames("main", "main"); //$NON-NLS-1$ //$NON-NLS-2$
// Notify the control object that it is embedded in an OLE container
@@ -902,6 +904,17 @@ private void onDispose(Event e) {
frame.Release();
frame = null;
+
+ if (objIOleObject != null) {
+ objIOleObject.Unadvise(token);
+ objIOleObject.SetClientSite(0);
+ objIOleObject.Close(COM.OLECLOSE_NOSAVE);
+ objIOleObject.Release();
+ }
+ objIOleObject = null;
+ if (COM.FreeUnusedLibraries) {
+ COM.CoFreeUnusedLibraries();
+ }
}
void onFocusIn(Event e) {
if (inDispose) return;
@@ -1100,13 +1113,7 @@ protected void releaseObjectInterfaces() {
if (objIOleInPlaceObject!= null)
objIOleInPlaceObject.Release();
objIOleInPlaceObject = null;
-
- if (objIOleObject != null) {
- objIOleObject.Close(COM.OLECLOSE_NOSAVE);
- objIOleObject.Release();
- }
- objIOleObject = null;
-
+
if (objDocumentView != null){
objDocumentView.Release();
}
@@ -1126,8 +1133,6 @@ protected void releaseObjectInterfaces() {
objIUnknown.Release();
}
objIUnknown = null;
-
- COM.CoFreeUnusedLibraries();
}
/**
* Saves the document to the specified file and includes OLE specific information if specified.
diff --git a/bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleFrame.java b/bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleFrame.java
index 2677f94545..9e4a5f43ba 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleFrame.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleFrame.java
@@ -598,7 +598,9 @@ int Release() {
refCount--;
if (refCount == 0){
disposeCOMInterfaces();
- COM.CoFreeUnusedLibraries();
+ if (COM.FreeUnusedLibraries) {
+ COM.CoFreeUnusedLibraries();
+ }
}
return refCount;
}

Back to the top