Bug 122157 - [Contributions] Improper disposal of controls when shutting down workbench
Summary: [Contributions] Improper disposal of controls when shutting down workbench
Status: ASSIGNED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-27 12:26 EST by Pratik Shah CLA
Modified: 2019-09-06 16:06 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pratik Shah CLA 2005-12-27 12:26:55 EST
We have a combo box on the toolbar for our editor.  If I close the workbench with unsaved changes in this editor, the combo box is disposed before its corresponding ActionContributionItem.  This problem does not occur when just closing the editor.  Our ActionContributionItem tries to refresh the combo (because doSave() causes a change to our command stack), and runs into a Widget Disposed Error in the former case, but not in the latter.

Of course, the simple workaround is to check to see if the combo's been disposed before trying to refresh it.  But there should be consistency in the procedure of closing an editor.  In particular, it seems the bug here is that the combo box is being disposed before the ActionContributionItem.
Comment 1 Douglas Pollock CLA 2006-01-03 11:02:34 EST
Can you attach a stack trace showing when your code is hit (in the case of the widget being disposed)?
Comment 2 Randy Hudson CLA 2006-01-03 11:20:23 EST
Pratik is on vacation for the next two weeks.

The stack trace contains "myEditor#doSave()". When we save, we reset the dirty marker on our undo stack, which causes a contribution on the toolbar to refresh itself. At that point, its widget is already disposed.

This is strange, because editor#doSave() gets called from the close listener of the Shell. My understanding is that the shell is not disposed until after the close listener has been notified and did not set doit=false. If so, the problem is in workbench code somewhere. Sounds like the EditorActionBarContributor's toolbar was disposed.
Comment 3 Douglas Pollock CLA 2006-01-03 11:26:38 EST
Could you attach the stack trace, please?
Comment 4 Randy Hudson CLA 2006-01-06 11:49:37 EST
This may be specific to GTK, I couldn't reproduce on M4/win32.
Comment 5 Pratik Shah CLA 2006-01-23 16:16:46 EST
Hmm, I couldn't reproduce it on GTK with 3.2M4 either.
Comment 6 Michael Van Meekeren CLA 2006-04-21 13:56:24 EDT
Moving Dougs bugs
Comment 7 Paul Webster CLA 2007-04-05 19:04:52 EDT
Assigning to component owner
PW
Comment 8 Eclipse Webmaster CLA 2019-09-06 16:06:44 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.