#14711: Memleak when creating QuadraticField
-------------------------------------------------+-------------------------
Reporter: jpflori | Owner:
Type: defect | davidloeffler
Priority: critical | Status: new
Component: number fields | Milestone: sage-5.12
Keywords: memleak, number field, | Resolution:
QuadraticField | Merged in:
Authors: | Reviewers:
Report Upstream: N/A | Work issues:
Branch: u/SimonKing/ticket/14711 | Commit:
Dependencies: | Stopgaps:
-------------------------------------------------+-------------------------
Comment (by SimonKing):
Replying to [comment:25 jpflori]:
> Not sure about the other uses of morphism though, a morphism could then
survive when its parent dies.
Isn't the homset containing the morphism keeping a strong reference to
domain and codomain, too? Or did I change this somewhere? So, would having
a weak reference to the domain actually help?
> But whats the point of keeping a morphism alive if you don't use its
parent?
Well, imagine a method that returns a morphism. You have constructed the
domain and the codomain inside of the method. It would be awkward to
return `domain, codomain, morphism` instead of only one item, `morphism`.
But if the morphism only keeps a weak reference to the domain, and if you
only return the morphism, then the domain might be garbage collected
during return, and this would make the morphism useless.
--
Ticket URL: <http://trac.sagemath.org/ticket/14711#comment:27>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/groups/opt_out.