Move unimplemented fn reset before ctx cleanup
@@ -124,10 +124,6 @@ static StatusTuple unimplemented_snprintf(char *, size_t, const void *) {
}
BPFModule::~BPFModule() {
- engine_.reset();
- rw_engine_.reset();
- ctx_.reset();
-
for (auto &v : tables_) {
v->key_sscanf = unimplemented_sscanf;
v->leaf_sscanf = unimplemented_sscanf;
@@ -135,6 +131,10 @@ BPFModule::~BPFModule() {
v->leaf_snprintf = unimplemented_snprintf;
}
+ engine_.reset();
+ rw_engine_.reset();
+ ctx_.reset();
+
ts_->DeletePrefix(Path({id_}));
}
