# HG changeset patch # User Rik # Date 1457884019 25200 # Node ID de155ca994d44fc6601c24fd482d8654f24ef910 # Parent 74b07936fd05086f0046a3ab6b20c98dcdde2e4b Ask glpk to free all resources used after solving problem. * __glpk__.cc (glpk): Call glp_free_env () at end of routine to free all resources. Prevents memory leaks being reported. diff -r 74b07936fd05 -r de155ca994d4 libinterp/dldfcn/__glpk__.cc --- a/libinterp/dldfcn/__glpk__.cc Sun Mar 13 07:34:27 2016 -0700 +++ b/libinterp/dldfcn/__glpk__.cc Sun Mar 13 08:46:59 2016 -0700 @@ -285,6 +285,11 @@ } glp_delete_prob (lp); + // Request that GLPK free all memory resources. + // This prevents reported memory leaks, but isn't strictly necessary. + // The memory blocks use are allocated once and don't grow with further + // calls to glpk so they would be reclaimed anyways when Octave exits. + glp_free_env (); return errnum; }