Migliorato il save e restore counter in modo da funzionare anche se ci sono bug o crash

This commit is contained in:
2013-12-18 18:23:29 +01:00
parent 4472599169
commit fc9310ad17
4 changed files with 14 additions and 8 deletions

View File

@@ -16,7 +16,7 @@ public class IdCounter {
public static void save_counter() throws FileNotFoundException,IOException,ClassNotFoundException{
File f_data = new File("id_counter");
Integer data = Integer.valueOf(Global.get_next_id() - 1);
Integer data = Integer.valueOf(Global.getGeneral_counter());
ObjectOutputStream writer = new ObjectOutputStream(new FileOutputStream(f_data));
writer.writeObject(data);
writer.close();