fix(stream): clear the freed ptr

This commit is contained in:
Haojun Liao 2024-08-05 19:32:29 +08:00
parent 79d4596b72
commit 94a2ea1ad5
1 changed files with 3 additions and 0 deletions

View File

@ -910,6 +910,7 @@ void streamBackendCleanup(void* arg) {
if (pHandle->db) {
rocksdb_close(pHandle->db);
pHandle->db = NULL;
}
rocksdb_options_destroy(pHandle->dbOpt);
rocksdb_env_destroy(pHandle->env);
@ -2508,6 +2509,7 @@ STaskDbWrapper* taskDbOpenImpl(const char* key, char* statePath, char* dbPath) {
}
rocksdb_close(pTaskDb->db);
pTaskDb->db = NULL;
if (cfNames != NULL) {
rocksdb_list_column_families_destroy(cfNames, nCf);
@ -2617,6 +2619,7 @@ void taskDbDestroy(void* pDb, bool flush) {
if (wrapper->db) {
rocksdb_close(wrapper->db);
wrapper->db = NULL;
}
rocksdb_options_destroy(wrapper->dbOpt);