Closed Atreyagaurav closed 9 months ago
I think we can call GDALGetDriver
until it returns NULL
, without checking the count. If the user adds new drivers during iterator, they might even get them back.
There's no safety issue and we can add a note saying it's a bad idea to register or unregister drivers during the iteration.
Following up from the discussions in #510.
I was thinking about it and came across a potential problem. We can add and remove the drivers during runtime, so if we keep track of the index and increase that to get the
Iterator::next()
, then we'll run into:Driver::get(i)
if driver(s) is/are removedSo, to make sure this doesn't happen, we can take a Vec of the Drivers and make an iterator out of it, but that defeats the purpose of the Iterators. But maybe that'll work, as we don't have to call the
get_driver(i)
ourselves in a loop.