Use std::shared_ptr to refer to FdEntity (#2541)
FdEntity may have multiple references due to ChangeEntityToTempPath. This relies on the std::enable_shared_from_this helper to create a std::shared_ptr from this. Fixes #2532.
This commit is contained in:
@ -1086,7 +1086,7 @@ int FdEntity::NoCacheLoadAndPost(PseudoFdInfo* pseudo_obj, off_t start, off_t si
|
||||
}
|
||||
|
||||
// Change entity key in manager mapping
|
||||
FdManager::get()->ChangeEntityToTempPath(this, path.c_str());
|
||||
FdManager::get()->ChangeEntityToTempPath(get_shared_ptr(), path.c_str());
|
||||
|
||||
// open temporary file
|
||||
int tmpfd;
|
||||
|
||||
Reference in New Issue
Block a user