mirror of
https://github.com/rdkit/rdkit.git
synced 2026-06-03 21:44:30 +08:00
... and more mem errors fixed (#7924)
* fixleak in CIP labels catch test * fix leak in Murtagh clustering * do not leak writers in streambuf * fix leaks in fingerprintgeneratorwrapper * remove 'minor leak' comments
This commit is contained in:
committed by
GitHub
parent
7546167033
commit
ccfb1fa688
@@ -529,11 +529,20 @@ class streambuf : public std::basic_streambuf<char> {
|
||||
exceptions(std::ios_base::badbit);
|
||||
}
|
||||
|
||||
// overload that takes ownership of the streambuf ptr
|
||||
ostream(streambuf *buf) : std::ostream(buf), m_buf(buf) {
|
||||
exceptions(std::ios_base::badbit);
|
||||
}
|
||||
|
||||
~ostream() override {
|
||||
if (this->good()) {
|
||||
this->flush();
|
||||
}
|
||||
delete m_buf;
|
||||
}
|
||||
|
||||
private:
|
||||
streambuf *m_buf = nullptr;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user