Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
File Leaking #907
Sometimes, data from other projects is found inside pclx files.
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.
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.
If you then unzip that pclx, you will find the sound you imported in the data folder.
I've been aware of this issue for a while because we don't delete audio files when removing a sound key.
I'm thinking to make a whitelist of the files that must be included in zip instead of zipping the whole working folder.
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.