Skip to content

Commit 5b035c6

Browse files
authored
Merge pull request #48040 from makortel/fixStorageMemoryLeaks
Fix memory leaks in TStorageFactoryFile and StorageAccountProxy
2 parents f0e1ab5 + c76ee42 commit 5b035c6

File tree

4 files changed

+3
-5
lines changed

4 files changed

+3
-5
lines changed

IOPool/TFileAdaptor/interface/TStorageFactoryFile.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ class TStorageFactoryFile : public TFile {
5555

5656
Bool_t ReadBuffersSync(char *buf, Long64_t *pos, Int_t *len, Int_t nbuf);
5757

58-
void releaseStorage() { get_underlying_safe(storage_).release(); }
59-
6058
TStorageFactoryFile(void);
6159

6260
edm::propagate_const<std::unique_ptr<edm::storage::Storage>> storage_; //< Real underlying storage

IOPool/TFileAdaptor/src/TStorageFactoryFile.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@ Int_t TStorageFactoryFile::SysClose(Int_t /* fd */) {
564564

565565
if (storage_) {
566566
storage_->close();
567-
releaseStorage();
567+
get_underlying_safe(storage_).reset();
568568
}
569569

570570
stats.tick();

Utilities/StorageFactory/interface/StorageAccountProxy.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ namespace edm::storage {
4040
void close(void) override;
4141

4242
protected:
43-
void releaseStorage() { get_underlying_safe(m_baseStorage).release(); }
43+
void resetStorage() { get_underlying_safe(m_baseStorage).reset(); }
4444

4545
edm::propagate_const<std::unique_ptr<Storage>> m_baseStorage;
4646

Utilities/StorageFactory/src/StorageAccountProxy.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ StorageAccountProxy::StorageAccountProxy(const std::string &storageClass, std::u
1616

1717
StorageAccountProxy::~StorageAccountProxy() {
1818
StorageAccount::Stamp stats(StorageAccount::counter(m_token, StorageAccount::Operation::destruct));
19-
releaseStorage();
19+
resetStorage();
2020
stats.tick();
2121
}
2222

0 commit comments

Comments
 (0)