1.1 --- a/lemon/glpk.cc Mon Feb 23 11:31:22 2009 +0000
1.2 +++ b/lemon/glpk.cc Mon Feb 23 22:54:25 2009 +0100
1.3 @@ -522,6 +522,10 @@
1.4 cols.clear();
1.5 }
1.6
1.7 + void GlpkBase::freeEnv() {
1.8 + glp_free_env();
1.9 + }
1.10 +
1.11 // GlpkLp members
1.12
1.13 GlpkLp::GlpkLp()
2.1 --- a/lemon/glpk.h Mon Feb 23 11:31:22 2009 +0000
2.2 +++ b/lemon/glpk.h Mon Feb 23 22:54:25 2009 +0100
2.3 @@ -102,6 +102,14 @@
2.4
2.5 public:
2.6
2.7 + /// \brief Deallocates the globally allocated memory of GLPK.
2.8 +
2.9 + /// Deallocates the globally allocated memory of GLPK. \note
2.10 + /// Usually, it do not have to be called, because the GLPK use
2.11 + /// only a small amount of global memory, and it is deallocated
2.12 + /// automatically at the end of program.
2.13 + static void freeEnv();
2.14 +
2.15 ///Pointer to the underlying GLPK data structure.
2.16 LPX *lpx() {return lp;}
2.17 ///Const pointer to the underlying GLPK data structure.
3.1 --- a/test/lp_test.cc Mon Feb 23 11:31:22 2009 +0000
3.2 +++ b/test/lp_test.cc Mon Feb 23 22:54:25 2009 +0100
3.3 @@ -366,6 +366,7 @@
3.4 lpTest(lp_glpk1);
3.5 aTest(lp_glpk2);
3.6 }
3.7 + GlpkLp::freeEnv();
3.8 #endif
3.9
3.10 #ifdef HAVE_CPLEX
4.1 --- a/test/mip_test.cc Mon Feb 23 11:31:22 2009 +0000
4.2 +++ b/test/mip_test.cc Mon Feb 23 22:54:25 2009 +0100
4.3 @@ -115,6 +115,7 @@
4.4 GlpkMip mip1;
4.5 aTest(mip1);
4.6 }
4.7 + GlpkLp::freeEnv();
4.8 #endif
4.9
4.10 #ifdef HAVE_CPLEX