You are absolutely right, the problem is that the log of the information is a reference to the log of the generator. The pho code apparently is the only one deleting the generator after using it, see the following lines in pho_constraints.cc:
...
pattern_generator = nullptr;
pdbs = pattern_collection_info.get_pdbs();
...
Switching these lines would fix this particular error, but of course, this error will always occur when deleting the generator and still using the result of the generator, i.e., the information object.
We could fix this by moving the log out of the generator, thus making the generator unusable afterwards. Currently, all generators produce results stored in shared pointers, handed to the information classes. Still, I'm sure the generators couldn't just be re-used without some effort after having them used once.
We could also "share" the log like everything else which is produced by generators and handed to information classes, but as advertised since years (c.f. issue906, and also related, issue911), I'm really against this. I think I likely wouldn't have made this error if the information classes where transferring ownership, rather than keeping shared pointers to everything created from the generators. The generators should be one-time usable factories that create everything they want and then go out of scope.
Another solution could be to stop producing output in the information classes. This would probably be the easiest fix for the time being.
|