Yes, we do need to delete m_op somehow.
authorDavid Gow <[email protected]>
Thu, 7 Aug 2014 14:45:02 +0000 (22:45 +0800)
committerDavid Gow <[email protected]>
Thu, 7 Aug 2014 14:45:02 +0000 (22:45 +0800)
src/gmpint.h

index f39cd51..6ed5303 100644 (file)
@@ -15,8 +15,7 @@ class Gmpint
                Gmpint(int64_t i) {mpz_init_set_si(m_op, i);}
                Gmpint(const std::string & str, int base=10) {mpz_init_set_str(m_op, str.c_str(), base);}
                Gmpint(const Gmpint & cpy) {mpz_init(m_op); mpz_set(m_op, cpy.m_op);}
                Gmpint(int64_t i) {mpz_init_set_si(m_op, i);}
                Gmpint(const std::string & str, int base=10) {mpz_init_set_str(m_op, str.c_str(), base);}
                Gmpint(const Gmpint & cpy) {mpz_init(m_op); mpz_set(m_op, cpy.m_op);}
-               virtual ~Gmpint() {} //TODO: Do we need to delete m_op somehow?
-               
+               virtual ~Gmpint() {mpz_clear(m_op);}
                
                operator int64_t() const {return mpz_get_si(m_op);}
                operator uint64_t() const {return mpz_get_ui(m_op);}
                
                operator int64_t() const {return mpz_get_si(m_op);}
                operator uint64_t() const {return mpz_get_ui(m_op);}

UCC git Repository :: git.ucc.asn.au