It seems like PyQrack is holding onto simulator instance garbage after destructors are called, but this is likely in the shared library itself, and the obvious suspects are the maps by (shared_ptr) QInterfacePtr. I'm testing, right now, whether removing these strong references lets garbage be disposed. I would use a weak_ptr rather than a raw pointer, and I have to apologize for that, but weak_ptr doesn't seem have ordering operators that allow it to be used as the keys of std::map, at least in C++11. However, it'll be obvious fairly quickly whether this change lets us release garbage, and we don't access these maps' keys in iteration over key-value pairs, (only values).
This is subject to change, but it will probably be accepted as-is, if tests in progress remain stable.
It seems like PyQrack is holding onto simulator instance garbage after destructors are called, but this is likely in the shared library itself, and the obvious suspects are the maps by (
shared_ptr
)QInterfacePtr
. I'm testing, right now, whether removing these strong references lets garbage be disposed. I would use aweak_ptr
rather than a raw pointer, and I have to apologize for that, butweak_ptr
doesn't seem have ordering operators that allow it to be used as the keys ofstd::map
, at least in C++11. However, it'll be obvious fairly quickly whether this change lets us release garbage, and we don't access these maps' keys in iteration over key-value pairs, (only values).This is subject to change, but it will probably be accepted as-is, if tests in progress remain stable.