lemon/glpk.h
changeset 538 ba124394367a
parent 537 0fec6a017ead
child 542 fc6c7aab4b8d
     1.1 --- a/lemon/glpk.h	Mon Feb 23 22:54:25 2009 +0100
     1.2 +++ b/lemon/glpk.h	Mon Feb 23 23:44:29 2009 +0100
     1.3 @@ -100,16 +100,20 @@
     1.4  
     1.5      virtual void _clear();
     1.6  
     1.7 +  private:
     1.8 +
     1.9 +    static void freeEnv();
    1.10 +
    1.11 +    struct FreeEnvHelper {
    1.12 +      ~FreeEnvHelper() {
    1.13 +        freeEnv();
    1.14 +      }
    1.15 +    };
    1.16 +    
    1.17 +    static FreeEnvHelper freeEnvHelper;
    1.18 +    
    1.19    public:
    1.20  
    1.21 -    /// \brief Deallocates the globally allocated memory of GLPK.
    1.22 -
    1.23 -    /// Deallocates the globally allocated memory of GLPK.  \note
    1.24 -    /// Usually, it do not have to be called, because the GLPK use
    1.25 -    /// only a small amount of global memory, and it is deallocated
    1.26 -    /// automatically at the end of program.
    1.27 -    static void freeEnv();
    1.28 -
    1.29      ///Pointer to the underlying GLPK data structure.
    1.30      LPX *lpx() {return lp;}
    1.31      ///Const pointer to the underlying GLPK data structure.