mirror of
https://github.com/Z3Prover/z3
synced 2025-04-06 17:44:08 +00:00
fix memory leak when using prime_generator as non-static object
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
110ca25e1b
commit
bd109c4522
|
@ -38,5 +38,5 @@ void tst_prime_generator() {
|
|||
ENSURE(p % i != 0);
|
||||
}
|
||||
}
|
||||
std::cout << std::endl;
|
||||
std::cout << std::endl;
|
||||
}
|
||||
|
|
|
@ -27,6 +27,11 @@ prime_generator::prime_generator() {
|
|||
process_next_k_numbers(128);
|
||||
}
|
||||
|
||||
prime_generator::~prime_generator() {
|
||||
dealloc(m_mux);
|
||||
m_mux = nullptr;
|
||||
}
|
||||
|
||||
void prime_generator::process_next_k_numbers(uint64_t k) {
|
||||
svector<uint64_t> todo;
|
||||
uint64_t begin = m_primes.back() + 2;
|
||||
|
|
|
@ -38,6 +38,7 @@ class prime_generator {
|
|||
public:
|
||||
mutex *m_mux;
|
||||
prime_generator();
|
||||
~prime_generator();
|
||||
uint64_t operator()(unsigned idx);
|
||||
void finalize();
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue