Confused by finalization behaviour

Hi @Blaise,
When you use a function constructor, you return an object that serves as a rhs in your assignment

u = LinAlg_Type('u',x)

That object is very short lived and will be finalized once the lhs is allocated/assigned.

If you do not want to get this behavior you need to use subroutine constructors with intent out arguments.

You can have a look at this discussion. You will probably find some more details about ‘final’

1 Like