An error occurred while fetching folder content.
Karl Ehatäht
authored
The ctor of GSLMCIntegrator creates GSLRngWrapper instance on the heap and calls Allocate() member function which in turn allocates memory for GSL random number generator via gsl_rng_alloc(). When GSLMCIntegrator instance goes out of scope, its dtor is invoked which deletes the GSLRngWrapper pointer and thus invokes its dtor as well. However, ~GSLRngWrapper() frees the allocated memory only if fOwn pointer is set to true, which is only set in assigment operator, but not in the Allocate() member function. Therefore, the GSLMCIntegrator is leaking memory. This poses a problem, when doing large number of integrations inside a for loop. The leak was discovered by running valgrind and inspecting the code.
Name | Last commit | Last update |
---|