Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 321000 - Comparing word documents does not kill WINWORD processes
Summary: Comparing word documents does not kill WINWORD processes
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Compare (show other bugs)
Version: 3.5.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.7 M2   Edit
Assignee: Platform-Compare-Inbox CLA
QA Contact: Szymon Brandys CLA
URL:
Whiteboard:
Keywords:
Depends on: 322122
Blocks:
  Show dependency tree
 
Reported: 2010-07-27 07:54 EDT by Krzysztof Kazmierczyk CLA
Modified: 2010-09-15 10:03 EDT (History)
3 users (show)

See Also:


Attachments
patch (1.63 KB, patch)
2010-08-11 08:22 EDT, Krzysztof Kazmierczyk CLA
no flags Details | Diff
patch (1.23 KB, patch)
2010-08-25 04:04 EDT, Krzysztof Kazmierczyk CLA
Szymon.Brandys: iplog+
Details | Diff
Krzysztof's patch with minor changes (3.86 KB, patch)
2010-08-25 06:55 EDT, Szymon Brandys CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Krzysztof Kazmierczyk CLA 2010-07-27 07:54:35 EDT
Build Identifier: 

Each comparing MS Word documents creates new process. The process is not killed when closing compared document. It leads to having many WINWORD processes when comparing intensively word documents..

The workaround is to kill these processes manually.

Reproducible: Always

Steps to Reproduce:
1. Add two word documents to workspace
2. Select these documents and choose "Compare with" -> "each other"
3. Close compare editor
4. Exit Eclipse
5. Go to Windows Task Manager. You will see WINWORD process.
Comment 1 Krzysztof Kazmierczyk CLA 2010-07-28 06:32:18 EDT
It seems to be comparing issue. 

 - Each time you compare documents, new WINWORD process is created.
 - When you open and close Word document in Eclipse several times only one WINWORD process is working.

However I observed that this one process when opening document is also never killed (another bug?)
Comment 2 Szymon Brandys CLA 2010-07-29 08:52:44 EDT
Those two cases may be related. Let's keep one bug report for now.
Comment 3 Krzysztof Kazmierczyk CLA 2010-08-05 10:19:03 EDT
The cause of many WINWORD processes is creating eac time OleClientSite(frame, SWT.NONE, "Word.Application"). This line is executed in org.eclipse.compare.internal.win32.WordComparision line 318.

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();	
}

Creates 5 WINWORD processes.

Felipe, do you know about this issue? Are you going to fix it in SWT?
Comment 4 Felipe Heidrich CLA 2010-08-05 12:07:55 EDT
(In reply to comment #3)
> Felipe, do you know about this issue? Are you going to fix it in SWT?
I fixed a bug very similar to this one in the past (maybe it was excell, can't remember). I do not have a bug number for this issue, I do not have a fix either.
Comment 5 Krzysztof Kazmierczyk CLA 2010-08-09 07:19:43 EDT
I have created bug 32122 for the issue mentioned in comment 3
Comment 6 Krzysztof Kazmierczyk CLA 2010-08-11 08:22:08 EDT
Created attachment 176328 [details]
patch


According to Felipe suggestion from bug 322122 comment 1
I have provided a patch. The patch quits word application without saving any changes before disposing it.
Comment 7 Krzysztof Kazmierczyk CLA 2010-08-25 04:04:01 EDT
Created attachment 177390 [details]
patch

After applying patch for bug 311011 the previous patch did not apply.
Here is patch which applies.
Comment 8 Szymon Brandys CLA 2010-08-25 06:55:50 EDT
Created attachment 177405 [details]
Krzysztof's patch with minor changes
Comment 9 Szymon Brandys CLA 2010-08-25 07:16:39 EDT
Released to HEAD. Thanks Krzysztof.
Comment 10 Malgorzata Janczarska CLA 2010-09-15 10:03:27 EDT
Verified on I20100912-2000, on Windows XP with Word 2002 (XP).