Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#176 closed defect (released)

Bug when saving recently edited army

Reported by: Henri Owned by: ibboard
Priority: minor Milestone: WarFoundry 0.1
Component: WarFoundry-API Version:
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by ibboard)

Sometimes when opening a file, editing a unit and trying to save right after I'll get a message telling me the file is being used in another process.

Strangely, the GTK# interface doesn't currently seem to suffer from the same problem - perhaps a Linux vs Windows filesystem difference.

Attachments (1)

crash3.txt (5.3 KB) - added by Henri 10 years ago.
debug information

Download all attachments as: .zip

Change History (16)

Changed 10 years ago by Henri

Attachment: crash3.txt added

debug information

comment:1 Changed 10 years ago by ibboard

Milestone: WarFoundry 0.1

I can't recreate it at the moment (were you doing anything else at the time? Did you have the file open with another app?), but I can see how it might happen. At the least we should give a better error message and not fail so badly.

comment:2 Changed 10 years ago by Henri

I still get this and as far as I am aware do not have any other app opened that would use this file. Of course with Windows who knows...

With just WF running "openly" , ie that I have started, opening a datafile and modifying it won't work.

comment:3 Changed 10 years ago by Henri

It also shows up if I load an army. Then create a new one and add 1 unit and immediately try to save. Then it will say that the army-file with the name I recently used is in use by another process.

comment:4 Changed 10 years ago by Henri

Additionally I'm having some strange issue where the point calculation is not correct.
I don't know (but it it seems related) if it is related or not but for some reason (I'm betting badly set up race-files) the equipment points are calculated differently when creating and then subsequently loading a file. A unit first only gets basic points (per model cost) added, but then later it is also charged the cost of the equipment.

comment:5 Changed 10 years ago by Henri

Additionally, now that I remember I have used the same "name" for the army in several files, but under different filenames obviously. If that might have some bearing on the matter.

comment:6 Changed 10 years ago by ibboard

(In r279) Re #176: Bug when saving recently edited army

  • Fix "saving over army" problem by wiping "loaded file path" when army changes

comment:7 Changed 10 years ago by ibboard

(In r280) Re #176: Bug when saving recently edited army

  • Make save button available whether army has previously been saved or not (partly for usability and partly to try to trigger bug)

Bug seems to occur when opening an army as the first action, adding a unit and saving it, but not when creating a new army as the first action, then loading an old army as the second action, then adding a unit and saving it

comment:8 Changed 10 years ago by ibboard

(In r281) Re #176: Bug when saving recently edited army

  • Try to make sure that we clear up our open streams

comment:9 Changed 10 years ago by ibboard

(In r283) Re #176: Bug when saving recently edited army

  • Try to make sure that we clear up more of our open streams

Bug seems to be state related in some way since I can only trigger it when loading the file as the first action, but doesn't seem to be related to file loading of other data files since a diagnostic hard-coded "LoadFiles()" call in the FrmMain constructor doesn't change the behaviour

comment:10 Changed 10 years ago by ibboard

Description: modified (diff)
Owner: set to ibboard
Status: newaccepted

I can't work this bug out at the moment. My only solution (one that works for me) is to always create a new army first. For some reason that I've yet to determine, that seems to stop the "load and save" hitting the "already in use" issue.

comment:11 Changed 10 years ago by Henri

Another "workaround" is to just "save as..." the file and give it a new name, that way it won't fail either.

comment:12 Changed 10 years ago by ibboard

Resolution: fixed
Status: acceptedclosed

(In r286) Fixes #176: Bug when saving recently edited army

  • Add loaded file cleanup to AbstractWarFoundryFactory
  • Add override of method with Zip reference closing to WarFoundryXmlFactory

WarFoundry now no longer ends up with trailing handles to files, although why they only caused problems in some situations is unknown

Also:

  • Some line ending fixes (curse cross-platform development and different line terminators!)

comment:13 Changed 10 years ago by ibboard

released: 1

Mark released changes as released

comment:14 Changed 10 years ago by ibboard

released: 1yes

Mark released fixes as released using radio values

comment:15 Changed 10 years ago by ibboard

Resolution: fixedreleased

Mark fix as released under a previous version

Note: See TracTickets for help on using tickets.