-
Notifications
You must be signed in to change notification settings - Fork 6.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
may be a code bug #3112
Comments
Interesting question. The |
I think an assert is more appropriate since cfd is not suppose to outlive the DB. I'll send a patch. |
amytai
pushed a commit
to amytai/rocksdb
that referenced
this issue
Mar 9, 2018
Summary: In ColumnFamilySet destructor, assert it hold the last reference to cfd before destroy them. Closes facebook#3112 Closes facebook#3397 Differential Revision: D6777967 Pulled By: yiwu-arbug fbshipit-source-id: 60b19070e0c194b3b6146699140c1d68777866cb
This was referenced Feb 5, 2024
This was referenced Mar 18, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
in the file db/column_family.cc ,the destructor of ColumnFamilySet, deleting cfd directly after dereferencing by call cfd->Unref();
I think we can delete cfd only when the cfd->Unref()== true, others we no need to delete!
ColumnFamilySet::~ColumnFamilySet() {
while (column_family_data_.size() > 0) {
// cfd destructor will delete itself from column_family_data_
auto cfd = column_family_data_.begin()->second;
cfd->Unref();
delete cfd; // this should do it when cfd->Unref()==true ?
}
dummy_cfd_->Unref();
delete dummy_cfd_;
}
The text was updated successfully, but these errors were encountered: