mirror of
https://github.com/arduino/Arduino.git
synced 2025-03-15 12:29:26 +01:00
Fix for bug 950 -- NPE Compiler.java:407 -- also searched for any other instances & found two other cases of the same bug
This commit is contained in:
parent
958c835ef0
commit
5e75bd4a97
@ -401,12 +401,8 @@ public class Compiler implements MessageConsumer {
|
|||||||
boolean compiling = true;
|
boolean compiling = true;
|
||||||
while (compiling) {
|
while (compiling) {
|
||||||
try {
|
try {
|
||||||
Thread t = in.thread;
|
in.join();
|
||||||
if (t != null)
|
err.join();
|
||||||
t.join();
|
|
||||||
t = err.thread;
|
|
||||||
if (t != null)
|
|
||||||
t.join();
|
|
||||||
result = process.waitFor();
|
result = process.waitFor();
|
||||||
//System.out.println("result is " + result);
|
//System.out.println("result is " + result);
|
||||||
compiling = false;
|
compiling = false;
|
||||||
|
@ -85,6 +85,13 @@ public class MessageSiphon implements Runnable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Wait until the MessageSiphon thread is complete.
|
||||||
|
public void join() throws java.lang.InterruptedException {
|
||||||
|
// Grab a temp copy in case another thread nulls the "thread"
|
||||||
|
// member variable
|
||||||
|
Thread t = thread;
|
||||||
|
if (t != null) t.join();
|
||||||
|
}
|
||||||
|
|
||||||
public Thread getThread() {
|
public Thread getThread() {
|
||||||
return thread;
|
return thread;
|
||||||
|
@ -63,10 +63,8 @@ public class Sizer implements MessageConsumer {
|
|||||||
|
|
||||||
while(running) {
|
while(running) {
|
||||||
try {
|
try {
|
||||||
if (in.thread != null)
|
in.join();
|
||||||
in.thread.join();
|
err.join();
|
||||||
if (err.thread != null)
|
|
||||||
err.thread.join();
|
|
||||||
r = process.waitFor();
|
r = process.waitFor();
|
||||||
running = false;
|
running = false;
|
||||||
} catch (InterruptedException intExc) { }
|
} catch (InterruptedException intExc) { }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user