New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File Leaking #907

Closed
scribblemaniac opened this Issue Mar 1, 2018 · 3 comments

Comments

Projects
None yet
3 participants
@scribblemaniac
Contributor

scribblemaniac commented Mar 1, 2018

--Issue Summary--

Sometimes, data from other projects is found inside pclx files.

--Actual Results--

When investigating the contents of some pclx files, I have found images and sounds from unrelated projects. Normally I would think this is just a case of something not getting cleaned up when loading or creating a new project, however these files are from projects that were not even loaded during the same instance of the Pencil2D process in which the problem file was created! This is not super high priority because these files don't actually appear in loaded animation, but it could slow down saving, increase file sizes, and has minor privacy concerns when sharing pclx files. Given the many saving issues lately, perhaps tracking this issue down might solve a bigger problem as well.

--Expected Results--

A pclx file should only contain images from its own project obviously.

--Steps to reproduce--

This is how to reproduce the issue with sound. I have not figured out a way to reproduce this issue with image sequences, although it is possible since it has happened to me before.

  1. Open Pencil2D
  2. Import a sound on a new layer (wav or mp3)
  3. Quit Pencil2D without saving
  4. Open Pencil2D again
  5. Save the new project as a pclx

If you then unzip that pclx, you will find the sound you imported in the data folder.

--System Information--

  • Pencil2D Version: 0.6.0 and Nightly Build Febuary 28th (a1825f7)

  • Operating System:
    macOS 10.13

  • RAM Size:
    16 GB

  • Graphics Tablet:
    N/A

@scribblemaniac scribblemaniac added the bug label Mar 1, 2018

@chchwy

This comment has been minimized.

Member

chchwy commented Mar 2, 2018

I've been aware of this issue for a while because we don't delete audio files when removing a sound key.
But deleting the file right after removing a key may not be good for undo.

I'm thinking to make a whitelist of the files that must be included in zip instead of zipping the whole working folder.

@CandyFace

This comment has been minimized.

Member

CandyFace commented Mar 9, 2018

Can't we just clean the work folder when exiting pencil2D and make sure the work folder is clean when making a new project? Should you have a project open already, to avoid cleaning the previous, the new project should generate a new work folder.

I agree that deleting the audio file might not be good a good idea since the undo/redo system depends on the file being in the work folder.

@chchwy chchwy added this to the 6.2 milestone Mar 14, 2018

@chchwy chchwy self-assigned this Jun 5, 2018

@chchwy

This comment has been minimized.

Member

chchwy commented Jun 5, 2018

Now I'm making a whitelist for zipping rather than zip the whole temp working folder. It will zip only the files which are used in the current project. It should fix the file leaking issue.

@chchwy chchwy closed this in 0248361 Jun 5, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment