Skip to content
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

caja-python-object.c: Remove the extra reference on the PyObject file wrappers when adding them to the python list. #64

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mtwebster
Copy link

PyObjects start with a refcount of 1. Adding them to a PyList adds
a second - which gets removes during the list's destruction. The
additional ref was keeping its associated CajaFile from ever being
finalized.

Steps to reproduce problem:

  1. Install python-caja and some python MenuProvider extension.
  2. Create a folder with a couple of image files inside. Be sure to
    allow thumbs to generate.
  3. Enter the folder, select one or more files (so menus are
    generated). De-select and leave the folder (but do not close
    caja). If you were to watch for the files' finalize to run,
    you'd notice it does not.
  4. touch or otherwise modify one of the image files from a terminal
  5. Re-enter the folder in caja.
  6. See that loading runs forever, modified file(s) never
    display. Note: even if you only modify one file, it could cause
    all of the files to fail to load, depending on their order during
    enumeration.

When no more views are displaying a file, that file should be finalized.
When it's not it ends up in an undefined state, as it has no monitors
flag it as needing to be updated

file wrappers when adding them to the python list. PyObjects start
with a refcount of 1. Adding them to a PyList adds a second - which
gets removes during the list's destruction. The additional ref was
keeping its associated CajaFile from ever being finalized.

Steps to reproduce problem:
1) Install python-caja and some python MenuProvider extension.
2) Create a folder with a couple of image files inside. Be sure to
   allow thumbs to generate.
3) Enter the folder, select one or more files (so menus are
   generated). De-select and leave the folder (but do not close
   caja). If you were to watch for the files' finalize to run,
   you'd notice it does not.
4) touch or otherwise modify one of the image files from a terminal
5) Re-enter the folder in caja.
6) See that loading runs forever, modified file(s) never
   display. Note: even if you only modify one file, it could cause
   all of the files to fail to load, depending on their order during
   enumeration.

When no more views are displaying a file, that file should be finalized.
When it's not it ends up in an undefined state, as it has no monitors
flag it as needing to be updated
@raveit65 raveit65 requested a review from a team April 6, 2021 06:02
@lukefromdc
Copy link
Member

What would be usable extensions for this? I am totally unfamiliar with most of the python extensions (I have just one and don't have problems with image files) but this sounds nasty

@mtwebster
Copy link
Author

caja-rename will trigger this, or folder-color-caja

mtwebster added a commit to mtwebster/caja that referenced this pull request May 16, 2021
When creating a new file (using a template, for instance), file->
details->is_added could potentially be FALSE, and cause this file to
not be finalized along with other files if the view directory is
destroyed.

This can cause issues when re-entering that directory, with the file
being in an undefined state, and could prevent the view from fully
loading the location (this is identical behavior to that described
in mate-desktop/python-caja#64.

To reproduce:
- Create an svg file and save in ~/Templates.
- Right-click, Create document-> svg file, name it whatever.
- Navigate out of the folder.
- Modify the file in a visible manner.
- Re-enter the folder, note that it never finishes loading.

Ref:
linuxmint/nemo#2736
lukefromdc pushed a commit to mate-desktop/caja that referenced this pull request May 19, 2021
When creating a new file (using a template, for instance), file->
details->is_added could potentially be FALSE, and cause this file to
not be finalized along with other files if the view directory is
destroyed.

This can cause issues when re-entering that directory, with the file
being in an undefined state, and could prevent the view from fully
loading the location (this is identical behavior to that described
in mate-desktop/python-caja#64.

To reproduce:
- Create an svg file and save in ~/Templates.
- Right-click, Create document-> svg file, name it whatever.
- Navigate out of the folder.
- Modify the file in a visible manner.
- Re-enter the folder, note that it never finishes loading.

Ref:
linuxmint/nemo#2736
@lukefromdc
Copy link
Member

Note that mate-desktop/caja#1528 fixed a related problem with thumbnails not loading after video files were rendered to the desktop, a job which takes several minutes. Those files are not readable until they are done, thus delaying thumbnail generation and usually blocking creation of the thumbnail prior to that

raveit65 pushed a commit to mate-desktop/caja that referenced this pull request Jul 21, 2022
When creating a new file (using a template, for instance), file->
details->is_added could potentially be FALSE, and cause this file to
not be finalized along with other files if the view directory is
destroyed.

This can cause issues when re-entering that directory, with the file
being in an undefined state, and could prevent the view from fully
loading the location (this is identical behavior to that described
in mate-desktop/python-caja#64.

To reproduce:
- Create an svg file and save in ~/Templates.
- Right-click, Create document-> svg file, name it whatever.
- Navigate out of the folder.
- Modify the file in a visible manner.
- Re-enter the folder, note that it never finishes loading.

Ref:
linuxmint/nemo#2736
@lukefromdc
Copy link
Member

What is the status of this? I don't have anything installed that could be used to test it and don't know enough about python to evaluate the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants