OSDN Git Service

Alter shutdown logic to try and remove hang on shutdown when synchronizing.
[neighbornote/NeighborNote.git] / src / cx / fbn / nevernote / NeverNote.java
index 3f4a0d7..045866f 100644 (file)
@@ -1003,7 +1003,13 @@ public class NeverNote extends QMainWindow{
                        //try {
                                logger.log(logger.MEDIUM, "Waiting for syncThread to stop");
                                System.out.println(tr("Synchronizing.  Please be patient."));
-                               while (!syncRunner.isIdle());
+                               for(;syncRunner.thread().isAlive();) {
+                                       try {
+                                               wait(10);
+                                       } catch (InterruptedException e) {
+                                               e.printStackTrace();
+                                       }
+                               }
                                logger.log(logger.MEDIUM, "Sync thread has stopped");
                        //} catch (InterruptedException e1) {
                        //      e1.printStackTrace();