Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • N nautilus-python
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Graph
    • Compare
  • Issues 8
    • Issues 8
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 1
    • Merge requests 1
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GNOMEGNOME
  • nautilus-python
  • Merge requests
  • !8

nautilus-python-object.c: Remove the extra reference on the PyObject file wrappers when adding them to a python list.

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Michael Webster requested to merge miketwebster/nautilus-python:extra-file-ref into master Feb 03, 2021
  • Overview 1
  • Commits 1
  • Pipelines 0
  • Changes 1

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 NautilusFile from ever being finalized.

Steps to reproduce problem:

  1. Install nautilus-python 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 nautilus). 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 nautilus.
  6. See that loading status 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.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: extra-file-ref