Skip to content
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

rocksdb: member function call and member invalidation #58

Open
qqiangwu opened this issue Mar 30, 2024 · 0 comments
Open

rocksdb: member function call and member invalidation #58

qqiangwu opened this issue Mar 30, 2024 · 0 comments

Comments

@qqiangwu
Copy link
Owner

void ColumnFamilyData::CreateNewMemtable(
    const MutableCFOptions& mutable_cf_options, SequenceNumber earliest_seq) {
  if (mem_ != nullptr) {
    delete mem_->Unref();
  }
  SetMemtable(ConstructNewMemtable(mutable_cf_options, earliest_seq));
  mem_->Ref();
}

gives:

➜  rocksdb-main git:(main) ✗ cppsafe -p build db/column_family.cc
/Users/wuqq/dev/rocksdb-main/db/column_family.cc:1137:3: warning: passing a dangling pointer as argument
 1137 |   mem_->Ref();
      |   ^~~~
/Users/wuqq/dev/rocksdb-main/db/column_family.cc:1134:5: note: deleted here
 1134 |     delete mem_->Unref();
      |     ^~~~~~~~~~~~~~~~~~~~
1 warning generated.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant