#17320: Memory leaks with LP Solvers are back
-------------------------------------+-------------------------------------
Reporter: pmueller | Owner:
Type: defect | Status: new
Priority: major | Milestone: sage-6.4
Component: linear | Resolution:
programming | Merged in:
Keywords: | Reviewers:
Authors: | Work issues:
Report Upstream: N/A | Commit:
Branch: | bc20667184ca8209776d8c363df2aa3e65994287
u/nbruin/memory_leaks_with_lp_solvers_are_back| Stopgaps:
Dependencies: |
-------------------------------------+-------------------------------------
Comment (by nbruin):
Replying to [comment:7 ncohen]:
> I do not understand why you put all this in a "try" block. Wouldn't it
be easier to just set `self.si` and `self.model` to NULL at the beginning,
and add "if self.model != NULL" in the dealloc ?
Quite possibly, but that's not how that code was written and I wasn't
planning on delving into the program logic. There's a "new ..." there and
there are uncontrolled exits via explicit raises and quite possibly by
other code that can generate errors. If the new model gets inserted into
self.model there's no leak because the old value of self.model gets
properly deleted, but all the error condition exits would lead to an
allocated "model" that simply falls out of scope, i.e., a memory leak
(unless cython generates an implicit try/finally to cleanly delete any
local variables that point to C++ objects).
I just expressed it as a try/finally to ensure we always have a chance to
see if "model" needs to be deleted. I'm sure there are other solutions.
--
Ticket URL: <http://trac.sagemath.org/ticket/17320#comment:8>
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/d/optout.