Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Leherbauer2016-04-19 09:59:43 +0000
committerAnton Leherbauer2016-04-19 10:00:39 +0000
commit10ba077124e266fb7cfa661241d044a3ee91e0d3 (patch)
treec581a739f114a15b1f7ebf8a1cf08ce916549295 /core/org.eclipse.cdt.core.win32/library
parent4ad7f81c23516c62f72787fdac07916eee5a8828 (diff)
downloadorg.eclipse.cdt-10ba077124e266fb7cfa661241d044a3ee91e0d3.tar.gz
org.eclipse.cdt-10ba077124e266fb7cfa661241d044a3ee91e0d3.tar.xz
org.eclipse.cdt-10ba077124e266fb7cfa661241d044a3ee91e0d3.zip
Bug 491972 - [winpty] Not enough storage is available to process this command
Diffstat (limited to 'core/org.eclipse.cdt.core.win32/library')
-rw-r--r--core/org.eclipse.cdt.core.win32/library/pty/jni/src/pty.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/core/org.eclipse.cdt.core.win32/library/pty/jni/src/pty.cpp b/core/org.eclipse.cdt.core.win32/library/pty/jni/src/pty.cpp
index d7d076ed2f3..a9865b0ad29 100644
--- a/core/org.eclipse.cdt.core.win32/library/pty/jni/src/pty.cpp
+++ b/core/org.eclipse.cdt.core.win32/library/pty/jni/src/pty.cpp
@@ -1,9 +1,9 @@
/*******************************************************************************
- * Copyright (c) 2013, 2014 Wind River Systems, Inc. and others.
- * 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
+ * Copyright (c) 2013, 2016 Wind River Systems, Inc. and others.
+ * 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
*
* Contributors:
* Wind River Systems - initial API and implementation
@@ -145,7 +145,7 @@ JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTYInputStream_read0
if (!ret || amount == 0)
amount = -1;
- if (!ret) {
+ if (!ret && fd2pty.find(fd) != fd2pty.end()) {
int rc = winpty_get_exit_code(winpty);
fd2rc.insert(std::pair<int, int>(fd, rc));
}
@@ -173,11 +173,11 @@ JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTYInputStream_close0(JNIE
fd2pty_Iter = fd2pty.find(fd);
if (fd2pty_Iter != fd2pty.end()) {
winpty_t* winpty = fd2pty_Iter -> second;
+ fd2pty.erase(fd2pty_Iter);
if (winpty != NULL) {
winpty_close(winpty);
winpty = NULL;
}
- fd2pty.erase(fd2pty_Iter);
}
return 0;
@@ -241,11 +241,11 @@ JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTYOutputStream_close0(JNI
fd2pty_Iter = fd2pty.find(fd);
if (fd2pty_Iter != fd2pty.end()) {
winpty_t* winpty = fd2pty_Iter -> second;
+ fd2pty.erase(fd2pty_Iter);
if (winpty != NULL) {
winpty_close(winpty);
winpty = NULL;
}
- fd2pty.erase(fd2pty_Iter);
}
return 0;

Back to the top