Community
Participate
Working Groups
Build Identifier: I20100608-0911 Exctracted from bug 321000. When you create and dispose "Word.Application" application component, no WINWORD process has been killed. Reproducible: Always Steps to Reproduce: Run Following code: Display display = new Display(); final Shell shell = new Shell(display); frame = new OleFrame(shell, SWT.NONE); for (int i = 0; i < 5; i++) { clientSite = new OleClientSite(frame, SWT.NONE, "Word.Application"); clientSite.dispose(); } Now you see 5 WINWORD processes in your Windows.
try this: Display display = new Display(); final Shell shell = new Shell(display); OleFrame frame = new OleFrame(shell, SWT.NONE); for (int i = 0; i < 5; i++) { OleClientSite clientSite = new OleClientSite(frame, SWT.NONE, "Word.Application"); OleAutomation automation = new OleAutomation(clientSite); int id = automation.getIDsOfNames(new String[] {"Quit"})[0]; automation.invoke(id); automation.dispose(); clientSite.dispose(); } frame.dispose(); shell.dispose(); display.dispose(); apparently this is how word works: see http://www.ms-news.net/f3262/word-saveas-ole-container-not-killing-process-2621451.html
(In reply to comment #1) > try this: > Display display = new Display(); > final Shell shell = new Shell(display); > OleFrame frame = new OleFrame(shell, SWT.NONE); > for (int i = 0; i < 5; i++) { > OleClientSite clientSite = new OleClientSite(frame, SWT.NONE, > "Word.Application"); > OleAutomation automation = new OleAutomation(clientSite); > int id = automation.getIDsOfNames(new String[] {"Quit"})[0]; > automation.invoke(id); > automation.dispose(); > clientSite.dispose(); > } > frame.dispose(); > shell.dispose(); > display.dispose(); > > apparently this is how word works: see > http://www.ms-news.net/f3262/word-saveas-ole-container-not-killing-process-2621451.html OK that works for me now. Thanks Felipe :) Should we close it as invalid?
I think so. I double checked that SWT is releasing all OLE components. Calling this "Quit" method is a MS Word thing, so makes sense that the application has to call it.