mirror of
https://github.com/rdkit/rdkit.git
synced 2026-06-04 21:54:27 +08:00
switch to a shared_array
This commit is contained in:
@@ -385,13 +385,12 @@ std::string extractId(const FPBReader_impl *dp_impl, unsigned int which) {
|
||||
reinterpret_cast<const char *>(dp_impl->dp_idChunk.get() + offset),
|
||||
len);
|
||||
} else {
|
||||
char *buff = new char[len + 1];
|
||||
boost::shared_array<char> buff(new char[len + 1]);
|
||||
buff[len] = 0;
|
||||
dp_impl->istrm->seekg(dp_impl->idChunkOffset +
|
||||
static_cast<std::streampos>(offset));
|
||||
dp_impl->istrm->read(reinterpret_cast<char *>(buff), len);
|
||||
res = std::string(reinterpret_cast<const char *>(buff));
|
||||
delete[] buff;
|
||||
dp_impl->istrm->read(reinterpret_cast<char *>(buff.get()), len);
|
||||
res = std::string(reinterpret_cast<const char *>(buff.get()));
|
||||
}
|
||||
return res;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user