The code compiles fine, but I’m running into a memory deallocation issue in
‘Dummy’ if I use ROMol derived from pickled strings:
Error: free(): double free detected in tcache 2
If, however, I go from pickle to SMILES and then to ROMol there is no memory
error. Somewhere, I’m deallocating memory twice. Any help would be
appreciated.
std::string MolPickle2Smiles(std::string& pickle) {
RDKit::ROMol molecule;
RDKit::MolPickler::molFromPickle(pickle,molecule);
return RDKit::MolToSmiles(molecule);
}
bool Dummy(std::string& pickle1, std::string& pickle2) {
RDKit::MOL_SPTR_VECT reacts;
reacts.clear();
//THIS DOESN’T WORK
RDKit::ROMol molecule;
RDKit::MolPickler::molFromPickle(pickle1,molecule);
reacts.push_back(RDKit::ROMOL_SPTR(&molecule));
//THIS WORKS
//reacts.push_back(RDKit::ROMOL_SPTR(RDKit::SmilesToMol(MolPickle2Smiles(pickle1))));
return 0;
}
Sent from my iPhone
_______________________________________________
Rdkit-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss