File tree 2 files changed +10
-1
lines changed
arduino-core/src/cc/arduino/packages
2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change 26
26
import cc .arduino .Constants ;
27
27
import cc .arduino .UpdatableBoardsLibsFakeURLsHandler ;
28
28
import cc .arduino .UploaderUtils ;
29
+ import cc .arduino .packages .Uploader ;
29
30
import cc .arduino .contributions .*;
30
31
import cc .arduino .contributions .libraries .*;
31
32
import cc .arduino .contributions .libraries .ui .LibraryManagerUI ;
@@ -961,6 +962,14 @@ public boolean handleQuit() {
961
962
// ignore
962
963
}
963
964
965
+ // kill uploader (if still alive)
966
+ UploaderUtils uploaderInstance = new UploaderUtils ();
967
+ Uploader uploader = uploaderInstance .getUploaderByPreferences (false );
968
+ if (uploader != null && uploader .programmerPid != null && uploader .programmerPid .isAlive ()) {
969
+ // kill the stuck programmer
970
+ uploader .programmerPid .destroyForcibly ();
971
+ }
972
+
964
973
if (handleQuitEach ()) {
965
974
// Save out the current prefs state
966
975
PreferencesData .save ();
Original file line number Diff line number Diff line change @@ -106,7 +106,7 @@ public String getAuthorizationKey() {
106
106
}
107
107
108
108
// static field for last executed programmer process ID
109
- static protected Process programmerPid ;
109
+ static public Process programmerPid ;
110
110
111
111
protected boolean executeUploadCommand (Collection <String > command ) throws Exception {
112
112
return executeUploadCommand (command .toArray (new String [command .size ()]));
You can’t perform that action at this time.
0 commit comments