Project: Eclipse_Platform_UI
Bug 354890 [Compatibility] Editor action bars get referenced twice if an error occurs
Reported: 2011-08-16 17:04:20 | Status: verified fixed

It seems that our reference count for editor action bars get incremented twice if an error occurs when calling the part's createPartControl(*) method. This means we have a leak. Thread [main] (Suspended (breakpoint at line 131 in EditorActionBars)) EditorActionBars.addRef() line: 131 EditorReference.createEditorActionBars(WorkbenchPage, EditorDescriptor, IEditorSite) line: 377 EditorReference.initialize(IWorkbenchPart) line: 320 CompatibilityEditor(CompatibilityPart).createPartControl(IWorkbenchPart, Composite) line: 144 CompatibilityEditor.createPartControl(IWorkbenchPart, Composite) line: 45 CompatibilityEditor(CompatibilityPart).create() line: 260 NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method] NativeMethodAccessorImpl.invoke(Object, Object[]) line: 48 DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 37 Method.invoke(Object, Object...) line: 600 MethodRequestor.execute() line: 56 InjectorImpl.processAnnotated(Class<Annotation>, Object, Class<?>, PrimaryObjectSupplier, PrimaryObjectSupplier, ArrayList<Class<?>>) line: 838 InjectorImpl.processAnnotated(Class<Annotation>, Object, Class<?>, PrimaryObjectSupplier, PrimaryObjectSupplier, ArrayList<Class<?>>) line: 818 InjectorImpl.inject(Object, PrimaryObjectSupplier, PrimaryObjectSupplier) line: 110 InjectorImpl.internalMake(Class<?>, PrimaryObjectSupplier, PrimaryObjectSupplier) line: 317 InjectorImpl.make(Class<T>, PrimaryObjectSupplier) line: 239 ContextInjectionFactory.make(Class<T>, IEclipseContext) line: 153 ReflectionContributionFactory.createFromBundle(Bundle, IEclipseContext, IEclipseContext, URI) line: 90 ReflectionContributionFactory.doCreate(String, IEclipseContext, IEclipseContext) line: 64 ReflectionContributionFactory.create(String, IEclipseContext) line: 53 ContributedPartRenderer.createWidget(MUIElement, Object) line: 141 PartRenderingEngine.createWidget(MUIElement, Object) line: 858 PartRenderingEngine.safeCreateGui(MUIElement, Object, IEclipseContext) line: 612 PartRenderingEngine.safeCreateGui(MUIElement) line: 714 PartRenderingEngine.access$2(PartRenderingEngine, MUIElement) line: 685 PartRenderingEngine$7.run() line: 679 SafeRunner.run(ISafeRunnable) line: 42 PartRenderingEngine.createGui(MUIElement) line: 664 StackRenderer.showTab(MUIElement) line: 721 LazyStackRenderer$1.handleEvent(Event) line: 66 UIEventHandler$1.run() line: 41 UISynchronizer(Synchronizer).syncExec(Runnable) line: 180 UISynchronizer.syncExec(Runnable) line: 150 Display.syncExec(Runnable) line: 4683 E4Application$1.syncExec(Runnable) line: 182 UIEventHandler.handleEvent(Event) line: 38 EventHandlerWrapper.handleEvent(Event, Permission) line: 197 EventHandlerTracker.dispatchEvent(EventHandlerWrapper, Permission, int, Event) line: 197 EventHandlerTracker.dispatchEvent(Object, Object, int, Object) line: 1 EventManager.dispatchEvent(Set<Entry<K,V>>, EventDispatcher<K,V,E>, int, E) line: 230 ListenerQueue<K,V,E>.dispatchEventSynchronous(int, E) line: 148 EventAdminImpl.dispatchEvent(Event, boolean) line: 135 EventAdminImpl.sendEvent(Event) line: 78 EventComponent.sendEvent(Event) line: 39 EventBroker.send(String, Object) line: 81 UIEventPublisher.notifyChanged(Notification) line: 58 PartStackImpl(BasicNotifierImpl).eNotify(Notification) line: 380 PartStackImpl(ElementContainerImpl<T>).setSelectedElement(T) line: 171 ModelServiceImpl.showElementInWindow(MWindow, MUIElement) line: 357 ModelServiceImpl.bringToTop(MUIElement) line: 311 PartServiceImpl.bringToTop(MPart) line: 315 PartServiceImpl.showPart(MPart, EPartService$PartState) line: 954 WorkbenchPage.busyOpenEditor(IEditorInput, String, boolean, int, IMemento, boolean) line: 2739

Files changed in fix:
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/e4/compatibility/CompatibilityPart.java