Open
Description
The following listing illustrates the problem. If the last statement is remove, Python segfaults on exit as it tries to destroy the already de-allocated f
object
import shogun as sg
import numpy as np
x_tr = np.random.randn(10, 2)
f = sg.RealFeatures(x_tr)
feats_train = sg.CombinedFeatures()
feats_train.append_feature_obj( f)
kernel = sg.CombinedKernel()
kernel.append_kernel(sg.GaussianKernel(3.0))
kernel.append_kernel(sg.PolyKernel(10, 1))
kernel.init(feats_train, feats_train)
sg.get_global_io().set_loglevel(0)
del kernel
print f # segfaults as object's refcounter decreases to zero when destroying the kernel
See also #4410 for the first report