diff options
author | vkalintiris <vasilis@netdata.cloud> | 2022-04-12 17:40:25 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-12 17:40:25 +0300 |
commit | e36fbebaa205c1c3c2304a8395e74a118bcca17b (patch) | |
tree | 24734ccc57839f9b8f6edb8c97513bb7f05183dd /ml | |
parent | 9e4ab2b70939044a4ff86dc5fc12746a5643bbe5 (diff) |
Delete ML-related data of a host in the proper order. (#12672)
Initialization of ML-related structures and threads should happen
when the underlying RRD objects have been fully initialized. Destruction
should happen in the opposite way, ie. before deleting an RRD host/dimension.
Diffstat (limited to 'ml')
-rw-r--r-- | ml/ml.cc | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -90,7 +90,10 @@ void ml_delete_dimension(RRDDIM *RD) { return; Host *H = static_cast<Host *>(RD->rrdset->rrdhost->ml_host); - H->removeDimension(D); + if (!H) + delete D; + else + H->removeDimension(D); RD->state->ml_dimension = nullptr; } |