mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-19 15:05:36 +02:00
[380025] [efs] shutdown in certain product shell sharing environments can result in NPE
This commit is contained in:
parent
840bbe1553
commit
447fa34bba
1 changed files with 35 additions and 24 deletions
|
@ -1,5 +1,5 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2009 IBM Corporation. All rights reserved.
|
||||
* Copyright (c) 2012 IBM Corporation. All rights reserved.
|
||||
* This program and the accompanying materials are made available under the terms
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
|
@ -12,6 +12,7 @@
|
|||
* Mike Kucera (IBM) - [241316] [efs] Cannot restore editors for RSE/EFS-backed resources
|
||||
* David McKnight (IBM) - [241316] [efs] Cannot restore editors for RSE/EFS-backed resources
|
||||
* David McKnight (IBM) - [291738] [efs] repeated queries to RSEFileStoreImpl.fetchInfo() in short time-span should be reduced
|
||||
* David McKnight (IBM) - [380025] [efs] shutdown in certain product shell sharing environments can result in NPE
|
||||
********************************************************************************/
|
||||
package org.eclipse.rse.internal.efs;
|
||||
|
||||
|
@ -226,11 +227,15 @@ public class RemoteEditorManager implements ISaveParticipant, IResourceChangeLis
|
|||
*/
|
||||
public boolean closeRemoteEditors() {
|
||||
boolean result = true;
|
||||
try {
|
||||
IWorkbench wb = PlatformUI.getWorkbench();
|
||||
if (wb != null){
|
||||
IWorkbenchWindow[] windows = wb.getWorkbenchWindows();
|
||||
if (windows != null){
|
||||
for (int w = 0; w < windows.length; w++){
|
||||
IWorkbenchWindow win = windows[w];
|
||||
IWorkbenchPage[] pages = win.getPages();
|
||||
if (pages != null){
|
||||
for (int p = 0; p < pages.length && result; p++){
|
||||
IWorkbenchPage page = pages[p];
|
||||
IEditorReference[] activeReferences = page.getEditorReferences();
|
||||
|
@ -255,6 +260,12 @@ public class RemoteEditorManager implements ISaveParticipant, IResourceChangeLis
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e){
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue