Home » Eclipse Projects » Remote Application Platform (RAP) » SWTException in CoolBarManager on disposed CoolItem
SWTException in CoolBarManager on disposed CoolItem [message #1115475] |
Tue, 24 September 2013 06:46 |
Yury Mising name Messages: 95 Registered: May 2010 Location: Russia |
Member |
|
|
We've got SWTException in our application based on RAP 2.1.
There are several coolItems iterated in CoolBarManager2
(CoolBarManager).update(boolean) line: 952
and updated.
During update the one of the iterated CoolItems is disposed and when the iterator will be on it - the SWTException thrown on getData method:
// Retrieve the corresponding contribution item from SWT's
// data.
if (sourceIndex < coolItems.length) {
destinationItem = (IContributionItem) coolItems[sourceIndex]
.getData();
} else {
destinationItem = null;
}
Here is the stack of the CoolItem disposing.
CoolItem.dispose() line: 281
ToolBarContributionItem2(ToolBarContributionItem).updateSize(boolean) line: 639
ToolBarContributionItem2(ToolBarContributionItem).update(String) line: 595
CoolBarManager$1.controlResized(ControlEvent) line: 267
TypedListener.handleEvent(Event) line: 256
EventTable.sendEvent(Event) line: 85
CoolBar(Widget).sendEvent(Event) line: 700
CoolBar(Widget).notifyListeners(int, Event) line: 602
CoolBar(Control).notifyResize(Point) line: 2416
CoolBar(Composite).notifyResize(Point) line: 882
CoolBar(Control).setBounds(Rectangle, boolean) line: 2401
CoolBar(Control).setBounds(Rectangle) line: 855
CoolBar(Control).setSize(Point) line: 969
CoolBar(Control).setSize(int, int) line: 989
CoolBar.relayout() line: 1025
CoolBar.destroyItem(CoolItem) line: 537
CoolItem.dispose() line: 288
ToolBarContributionItem2(ToolBarContributionItem).updateSize(boolean) line: 639
ToolBarContributionItem2(ToolBarContributionItem).update(String) line: 595
CoolBarManager$1.controlResized(ControlEvent) line: 267
TypedListener.handleEvent(Event) line: 256
EventTable.sendEvent(Event) line: 85
CoolBar(Widget).sendEvent(Event) line: 700
CoolBar(Widget).notifyListeners(int, Event) line: 602
CoolBar(Control).notifyResize(Point) line: 2416
CoolBar(Composite).notifyResize(Point) line: 882
CoolBar(Control).setBounds(Rectangle, boolean) line: 2401
CoolBar(Control).setBounds(Rectangle) line: 855
CoolBar(Control).setSize(Point) line: 969
CoolBar(Control).setSize(int, int) line: 989
CoolBar.relayout() line: 1025
CoolItem.setSize(int, int) line: 724
CoolItem.setSize(Point) line: 753
ToolBarContributionItem2(ToolBarContributionItem).updateSize(boolean) line: 662
ToolBarContributionItem2(ToolBarContributionItem).fill(CoolBar, int) line: 251
CoolBarManager2(CoolBarManager).update(boolean) line: 952
SubCoolBarManager.update(boolean) line: 99
VisualReportViewerContributor(AbstractPageEditorContributor).updateBars() line: 481
VisualReportViewerContributor(AbstractPageEditorContributor).updateActiveContributor() line: 445
VisualReportViewerContributor(AbstractPageEditorContributor).setActivePage(IEditorPart) line: 179
VisualReportViewerContributor(MultiPageEditorActionBarContributor).setActiveEditor(IEditorPart) line: 51
VisualReportViewerContributor(AbstractPageEditorContributor).setActiveEditor(IEditorPart) line: 102
EditorActionBars.partChanged(IWorkbenchPart) line: 343
WorkbenchPage$3.run() line: 638
SafeRunner.run(ISafeRunnable) line: 42
Platform.run(ISafeRunnable) line: 854
WorkbenchPage.activatePart(IWorkbenchPart) line: 627
WorkbenchPage.setActivePart(IWorkbenchPart, boolean) line: 3527
WorkbenchPage.internalActivate(IWorkbenchPart, boolean) line: 620
WorkbenchPage.activate(IWorkbenchPart) line: 592
WorkbenchPage.busyOpenEditorBatched(IEditorInput, String, boolean, int, IMemento) line: 2870
WorkbenchPage.busyOpenEditor(IEditorInput, String, boolean, int, IMemento) line: 2763
WorkbenchPage.access$11(WorkbenchPage, IEditorInput, String, boolean, int, IMemento) line: 2755
WorkbenchPage$10.run() line: 2706
BusyIndicator.showWhile(Display, Runnable) line: 66
WorkbenchPage.openEditor(IEditorInput, String, boolean, int, IMemento) line: 2702
WorkbenchPage.openEditor(IEditorInput, String, boolean, int) line: 2686
IDE.openEditor(IWorkbenchPage, IEditorInput, String, boolean, int) line: 209
IDE.openEditor(IWorkbenchPage, IEditorInput, String, int) line: 126
IDE.openEditor(IWorkbenchPage, IEditorInput, String) line: 95
RAPDocumentService(DocumentService).internalOpenEditor(IDocument, Map, boolean) line: 711
DocumentService.access$8(DocumentService, IDocument, Map, boolean) line: 665
DocumentService$1.run() line: 550
RunnableLock.run() line: 38
UISynchronizer(Synchronizer).runAsyncMessages(boolean) line: 180
Display.runPendingMessages() line: 1189
Display.safeReadAndDispatch() line: 1169
Display.readAndDispatch() line: 1161
Workbench.runEventLoop(Window$IExceptionHandler, Display) line: 2733
Workbench.runUI() line: 2694
Workbench.access$5(Workbench) line: 2530
Workbench$5.run() line: 701
Realm.runWithDefault(Realm, Runnable) line: 332
Workbench.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 684
PlatformUI.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 157
BiAdminEntryPoint.createUI(Display) line: 56
BiAdminEntryPoint(BaseEntryPoint).createUI() line: 160
RWTLifeCycle.createUI() line: 186
RWTLifeCycle$UIThreadController.run() line: 298
UIThread(Thread).run() line: 619
UIThread.run() line: 104
Removing the org.eclipse.jface.action.CoolBarManager.addCoolBarResizeListener() method solves the p[roblem, but it seems to me not a cause and solution.
Can you provide some thoughts about this and, probably, confirm a bug?
Best regards,
Yury.
|
|
|
Re: SWTException in CoolBarManager on disposed CoolItem [message #1115499 is a reply to message #1115475] |
Tue, 24 September 2013 07:22 |
Ivan Furnadjiev Messages: 2427 Registered: July 2009 Location: Sofia, Bulgaria |
Senior Member |
|
|
Hi Yury,
the coolbar resize listener is RAP specific code (workaround for text
size determination issues) and it's probably a bug in RAP.
If item is disposed the call
....
coolItems = coolBar.getItems(); (line 907)
....
should not return it. For me it sounds like a bug in CoolItem disposal code.
Could you investigate why CoolBar#getItems() returns disposed items?
Also please open a bugzilla with a snippet to reproduce the issue.
Thanks,
Ivan
On 9/24/2013 9:46 AM, Yury Mising name wrote:
> We've got SWTException in our application based on RAP 2.1.
> There are several coolItems iterated in CoolBarManager2
> (CoolBarManager).update(boolean) line: 952
> and updated.
> During update the one of the iterated CoolItems is disposed and when
> the iterator will be on it - the SWTException thrown on getData method:
>
> // Retrieve the corresponding contribution item from SWT's
> // data.
> if (sourceIndex < coolItems.length) {
> destinationItem = (IContributionItem)
> coolItems[sourceIndex]
> .getData();
> } else {
> destinationItem = null;
> }
>
>
> Here is the stack of the CoolItem disposing.
>
> CoolItem.dispose() line: 281
> ToolBarContributionItem2(ToolBarContributionItem).updateSize(boolean)
> line: 639
> ToolBarContributionItem2(ToolBarContributionItem).update(String)
> line: 595
> CoolBarManager$1.controlResized(ControlEvent) line: 267
> TypedListener.handleEvent(Event) line: 256
> EventTable.sendEvent(Event) line: 85
> CoolBar(Widget).sendEvent(Event) line: 700
> CoolBar(Widget).notifyListeners(int, Event) line: 602
> CoolBar(Control).notifyResize(Point) line: 2416
> CoolBar(Composite).notifyResize(Point) line: 882
> CoolBar(Control).setBounds(Rectangle, boolean) line: 2401
> CoolBar(Control).setBounds(Rectangle) line: 855
> CoolBar(Control).setSize(Point) line: 969
> CoolBar(Control).setSize(int, int) line: 989
> CoolBar.relayout() line: 1025
> CoolBar.destroyItem(CoolItem) line: 537
> CoolItem.dispose() line: 288
> ToolBarContributionItem2(ToolBarContributionItem).updateSize(boolean)
> line: 639
> ToolBarContributionItem2(ToolBarContributionItem).update(String)
> line: 595
> CoolBarManager$1.controlResized(ControlEvent) line: 267
> TypedListener.handleEvent(Event) line: 256
> EventTable.sendEvent(Event) line: 85
> CoolBar(Widget).sendEvent(Event) line: 700
> CoolBar(Widget).notifyListeners(int, Event) line: 602
> CoolBar(Control).notifyResize(Point) line: 2416
> CoolBar(Composite).notifyResize(Point) line: 882
> CoolBar(Control).setBounds(Rectangle, boolean) line: 2401
> CoolBar(Control).setBounds(Rectangle) line: 855
> CoolBar(Control).setSize(Point) line: 969
> CoolBar(Control).setSize(int, int) line: 989
> CoolBar.relayout() line: 1025
> CoolItem.setSize(int, int) line: 724
> CoolItem.setSize(Point) line: 753
> ToolBarContributionItem2(ToolBarContributionItem).updateSize(boolean)
> line: 662
> ToolBarContributionItem2(ToolBarContributionItem).fill(CoolBar,
> int) line: 251
> CoolBarManager2(CoolBarManager).update(boolean) line: 952
> SubCoolBarManager.update(boolean) line: 99
> VisualReportViewerContributor(AbstractPageEditorContributor).updateBars()
> line: 481
> VisualReportViewerContributor(AbstractPageEditorContributor).updateActiveContributor()
> line: 445
> VisualReportViewerContributor(AbstractPageEditorContributor).setActivePage(IEditorPart)
> line: 179
> VisualReportViewerContributor(MultiPageEditorActionBarContributor).setActiveEditor(IEditorPart)
> line: 51
> VisualReportViewerContributor(AbstractPageEditorContributor).setActiveEditor(IEditorPart)
> line: 102
> EditorActionBars.partChanged(IWorkbenchPart) line: 343
> WorkbenchPage$3.run() line: 638
> SafeRunner.run(ISafeRunnable) line: 42
> Platform.run(ISafeRunnable) line: 854
> WorkbenchPage.activatePart(IWorkbenchPart) line: 627
> WorkbenchPage.setActivePart(IWorkbenchPart, boolean) line: 3527
> WorkbenchPage.internalActivate(IWorkbenchPart, boolean) line: 620
> WorkbenchPage.activate(IWorkbenchPart) line: 592
> WorkbenchPage.busyOpenEditorBatched(IEditorInput, String, boolean,
> int, IMemento) line: 2870
> WorkbenchPage.busyOpenEditor(IEditorInput, String, boolean, int,
> IMemento) line: 2763
> WorkbenchPage.access$11(WorkbenchPage, IEditorInput, String,
> boolean, int, IMemento) line: 2755
> WorkbenchPage$10.run() line: 2706
> BusyIndicator.showWhile(Display, Runnable) line: 66
> WorkbenchPage.openEditor(IEditorInput, String, boolean, int,
> IMemento) line: 2702
> WorkbenchPage.openEditor(IEditorInput, String, boolean, int) line:
> 2686
> IDE.openEditor(IWorkbenchPage, IEditorInput, String, boolean, int)
> line: 209
> IDE.openEditor(IWorkbenchPage, IEditorInput, String, int) line: 126
> IDE.openEditor(IWorkbenchPage, IEditorInput, String) line: 95
> RAPDocumentService(DocumentService).internalOpenEditor(IDocument,
> Map, boolean) line: 711
> DocumentService.access$8(DocumentService, IDocument, Map, boolean)
> line: 665
> DocumentService$1.run() line: 550
> RunnableLock.run() line: 38
> UISynchronizer(Synchronizer).runAsyncMessages(boolean) line: 180
> Display.runPendingMessages() line: 1189
> Display.safeReadAndDispatch() line: 1169
> Display.readAndDispatch() line: 1161
> Workbench.runEventLoop(Window$IExceptionHandler, Display) line: 2733
> Workbench.runUI() line: 2694
> Workbench.access$5(Workbench) line: 2530
> Workbench$5.run() line: 701
> Realm.runWithDefault(Realm, Runnable) line: 332
> Workbench.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 684
> PlatformUI.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 157
> BiAdminEntryPoint.createUI(Display) line: 56
> BiAdminEntryPoint(BaseEntryPoint).createUI() line: 160
> RWTLifeCycle.createUI() line: 186
> RWTLifeCycle$UIThreadController.run() line: 298
> UIThread(Thread).run() line: 619
> UIThread.run() line: 104
>
>
> Removing the
> org.eclipse.jface.action.CoolBarManager.addCoolBarResizeListener()
> method solves the p[roblem, but it seems to me not a cause and solution.
>
> Can you provide some thoughts about this and, probably, confirm a bug?
>
> Best regards,
> Yury.
--
Ivan Furnadjiev
Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/
Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
|
|
| |
Re: SWTException in CoolBarManager on disposed CoolItem [message #1115629 is a reply to message #1115539] |
Tue, 24 September 2013 11:02 |
Ivan Furnadjiev Messages: 2427 Registered: July 2009 Location: Sofia, Bulgaria |
Senior Member |
|
|
Hi Yury,
do you have a proposal for a fix without removing the coolbar resize
listener?
Best,
Ivan
On 9/24/2013 11:27 AM, Yury Mising name wrote:
> Hello, Ivan!
>
> First of all, Thank you for quick response!
>
> coolItems = coolBar.getItems(); (line 907)
>
> Does not return disposed item - it will be disposed later in
> sourceItem.fill(coolBar, destinationIndex);
> by calling relayout, size changing and listeners calling - where the
> CoolItem from coolBar.getItems() collection will be disposed (note
> that it will be disposed twice, see
> org.eclipse.swt.widgets.CoolItem.dispose()
>
> public void dispose() {
> if ( isDisposed() )
> return;
>
> /*
> * Must call parent.destroyItem() before super.dispose(), since it
> needs to
> * query the bounds to properly remove the item.
> */
> parent.destroyItem( this ); <-- calling this before super.dispose()
> leads to calling CoolItem.dispose again
> super.dispose();
> parent = null;
> control = null;
>
> /*
> * Although the parent for the chevron is the CoolBar (CoolItem can
> not be
> * the parent) it has to be disposed with the item
> */
> if ( chevron != null && !chevron.isDisposed() )
> chevron.dispose();
> chevron = null;
> if (arrowImage != null && !arrowImage.isDisposed())
> arrowImage.dispose();
> arrowImage = null;
>
> }
>
>
> It is not pretty simple to create a snippet, that is why I'm asking
> here for help :)
>
> Best regards,
> Yury.
>
--
Ivan Furnadjiev
Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/
Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
|
|
| | | |
Goto Forum:
Current Time: Thu Sep 26 12:14:28 GMT 2024
Powered by FUDForum. Page generated in 0.06717 seconds
|