Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • otb otb
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 204
    • Issues 204
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 11
    • Merge requests 11
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Main Repositories
  • otbotb
  • Merge requests
  • !931

Fix unreleased reference count

  • Review changes

  • Download
  • Email patches
  • Plain diff
Open Luc Hermitte requested to merge lhermitte/otb:AutoLightObjects into develop Sep 19, 2022
  • Overview 0
  • Commits 8
  • Pipelines 6
  • Changes 7

Summary

Fixes crashing tests (in non release mode), related to itk::LightObject check in its destructor.

assert(!"Trying to delete object with non-zero reference count.");

Rationale

otb::Function::AmplitudeFunctor, otb::Function::PhaseFunctor and otb::ScalarToRainbowRGBPixelFunctor all inherit from itk::LightObject. Instances of this type needs to be created through their related ::New() functions and handled through ITK smart-pointer. In the case they are directly put on the stack/handled automatically, the reference count will never reach 0, which is considered a programming error (hint: the assertion & and the following warning in release mode).

Implementation Details

The two phase and amplitude functor tests no longer create the functors on the stack but through :New().

And otb::ScalarToRainbowRGBPixelFunctor has been refactored to integrate the code from its direct ITK parent type (which is an ITK function and not a ITK functor) and remove the coupling to itk::LightObject. This permits to store it in itk::UnaryFunction<>

Copyright

The copyright owner is CNES and has signed the ORFEO ToolBox Contributor License Agreement.


Check before merging:

  • All discussions are resolved
  • At least 2 👍 votes from core developers, no 👎 vote.
  • The feature branch is (reasonably) up-to-date with the base branch
  • Dashboard is green
  • Copyright owner has signed the ORFEO ToolBox Contributor License Agreement
  • Optionally, run git diff develop... -U0 --no-color | clang-format-diff.py -p1 -i on latest changes and commit
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: AutoLightObjects