Bug #1689

memory leak in ParameterSample

Added by ganeva about 3 years ago. Updated about 3 years ago.

Status:ResolvedStart date:29 Nov 2016
Priority:NormalDue date:
Assignee:jmfisher% Done:

0%

Category:-
Target version:-

Description

The following simple script

import bornagain as ba
from bornagain import angstrom

# create a wavelength divergence
nsamples = 5
xmin = 7.8 * angstrom
xmax = 8.2 * angstrom
wl_distr = ba.DistributionGaussian(8.0 * angstrom, 0.8 * angstrom / 2.355)
sample_points = wl_distr.generateSamples(nsamples, xmin, xmax)
print sample_points

produces a following message:

swig/python detected a memory leak of type 'std::vector< ParameterSample,std::allocator< ParameterSample > > *', no destructor found.

History

#1 Updated by ganeva about 3 years ago

  • Status changed from New to Sprint
  • Assignee set to jmfisher

#2 Updated by jmfisher about 3 years ago

It appears that the template std::vector< ParameterSample > > is not being exported by swig. So it should be a simple matter of updating and regenerating the bindings.

#3 Updated by jmfisher about 3 years ago

I believe that due to API changes wl_distr.generateSamples(nsamples, xmin, xmax) should instead be something like wl_distr.equidistantSamplesInRange(nsamples, xmin, xmax) if one is working from the develop branch.

#4 Updated by ganeva about 3 years ago

  • Status changed from Sprint to Resolved

Also available in: Atom PDF