Changeset 12310
- Timestamp:
- 2006-07-27T13:52:26+12:00 (18 years ago)
- Location:
- trunk/gli/src/org/greenstone/gatherer
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/Gatherer.java
r12225 r12310 74 74 75 75 /** Has the exit flag been set? */ 76 static final public int EXIT_THEN_RESTART= 2; 76 77 static public boolean exit = false; 78 static public int exit_status = 0; 77 79 78 80 static private String gli_directory_path = null; … … 496 498 * @see org.greenstone.gatherer.gui.GUIManager 497 499 */ 498 static public void exit(int exit_status)500 static public void exit(int new_exit_status) 499 501 { 500 502 DebugStream.println("In Gatherer.exit()..."); 501 503 exit = true; 504 if (new_exit_status != 0) { 505 // default exit_status is already 0 506 // only remember a new exit status if it is non-trivial 507 exit_status = new_exit_status; 508 } 502 509 503 510 // Save the file associations … … 876 883 // Call exit if we were the last outstanding child process thread. 877 884 if (apps.size() == 0 && exit == true) { 878 System.exit(0); 885 // In my opinion (DB) there is no need to exit here, 886 // the 'run' method ending naturally brings this 887 // thread to an end. In fact it is potentially 888 // dangerous to exit here, as the main thread in the 889 // Gatherer class may be stopped prematurely. As it so 890 // happens the point at which the ExternalApplication thread 891 // is asked to stop (Back in the main Gatherer thread) is after 892 // various configuration files have been saved. 893 // 894 // A similar argument holds for BrowserApplication thread below. 895 System.exit(exit_status); 879 896 } 880 897 } … … 957 974 // Call exit if we were the last outstanding child process thread. 958 975 if (apps.size() == 0 && exit == true) { 959 System.exit( 0);976 System.exit(exit_status); 960 977 } 961 978 } -
trunk/gli/src/org/greenstone/gatherer/gui/Preferences.java
r12225 r12310 794 794 795 795 if (restart_required) { 796 Gatherer.exit( 2);796 Gatherer.exit(Gatherer.EXIT_THEN_RESTART); 797 797 } 798 798 }
Note:
See TracChangeset
for help on using the changeset viewer.