Commit b04251e1 authored by Brice Videau's avatar Brice Videau

Fix memory leak.

parent ade5ece6
......@@ -228,13 +228,13 @@ class ConfigurationSpace(Context):
v = ccs_configuration()
res = ccs_configuration_space_get_default_configuration(self.handle, ct.byref(v))
Error.check(res)
return Configuration.from_handle(v)
return Configuration(handle = v, retain = False)
def sample(self):
v = ccs_configuration()
res = ccs_configuration_space_sample(self.handle, ct.byref(v))
Error.check(res)
return Configuration.from_handle(v)
return Configuration(handle = v, retain = False)
def samples(self, count):
if count == 0:
......@@ -242,6 +242,6 @@ class ConfigurationSpace(Context):
v = (ccs_configuration * count)()
res = ccs_configuration_space_samples(self.handle, count, v)
Error.check(res)
return [Configuration.from_handle(x) for x in v]
return [Configuration(handle = ccs_configuration(x), retain = False) for x in v]
from .configuration import Configuration
......@@ -92,7 +92,7 @@ class Tuner(Object):
res = ccs_tuner_ask(self.handle, count, v, ct.byref(c))
Error.check(res)
count = c.value
return [Configuration.from_handle(ccs_configuration(v[x])) for x in range(count)]
return [Configuration(handle = ccs_configuration(v[x]), retain = False) for x in range(count)]
def tell(self, evaluations):
count = len(evaluations)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment