# HG changeset patch # User Balazs Dezso # Date 1235426065 -3600 # Node ID 0fec6a017eaddac797518d40c102144176c47fad # Parent 06e0fb20a97c9f9acbbd88cba806271b7c97ef08 Fix GLPK tests (#213) diff -r 06e0fb20a97c -r 0fec6a017ead lemon/glpk.cc --- a/lemon/glpk.cc Mon Feb 23 11:31:22 2009 +0000 +++ b/lemon/glpk.cc Mon Feb 23 22:54:25 2009 +0100 @@ -522,6 +522,10 @@ cols.clear(); } + void GlpkBase::freeEnv() { + glp_free_env(); + } + // GlpkLp members GlpkLp::GlpkLp() diff -r 06e0fb20a97c -r 0fec6a017ead lemon/glpk.h --- a/lemon/glpk.h Mon Feb 23 11:31:22 2009 +0000 +++ b/lemon/glpk.h Mon Feb 23 22:54:25 2009 +0100 @@ -102,6 +102,14 @@ public: + /// \brief Deallocates the globally allocated memory of GLPK. + + /// Deallocates the globally allocated memory of GLPK. \note + /// Usually, it do not have to be called, because the GLPK use + /// only a small amount of global memory, and it is deallocated + /// automatically at the end of program. + static void freeEnv(); + ///Pointer to the underlying GLPK data structure. LPX *lpx() {return lp;} ///Const pointer to the underlying GLPK data structure. diff -r 06e0fb20a97c -r 0fec6a017ead test/lp_test.cc --- a/test/lp_test.cc Mon Feb 23 11:31:22 2009 +0000 +++ b/test/lp_test.cc Mon Feb 23 22:54:25 2009 +0100 @@ -366,6 +366,7 @@ lpTest(lp_glpk1); aTest(lp_glpk2); } + GlpkLp::freeEnv(); #endif #ifdef HAVE_CPLEX diff -r 06e0fb20a97c -r 0fec6a017ead test/mip_test.cc --- a/test/mip_test.cc Mon Feb 23 11:31:22 2009 +0000 +++ b/test/mip_test.cc Mon Feb 23 22:54:25 2009 +0100 @@ -115,6 +115,7 @@ GlpkMip mip1; aTest(mip1); } + GlpkLp::freeEnv(); #endif #ifdef HAVE_CPLEX