Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DriverManage::deregister_driver() leaks memory (if it is not re-registered afterwards) #482

Open
rouault opened this issue Dec 1, 2023 · 0 comments

Comments

@rouault
Copy link
Contributor

rouault commented Dec 1, 2023

Once DriverManager::deregister_driver() has been called on a driver that driver is in a detached state. Unfortunately there's nothing in the GDAL C API to explicit delete such a driver (if there was, I guess a potential fix would be to add a bool is_detached member to struct Driver and implement drop()), but this might imply changes in ownership/lifetime of the methods related to driver.
Another idea I considered would be to have deregister_driver() put the driver in a list of drivers that must be re-attached before calling GDALDestroyDriverManager(), but there's no guarantee DriverManager::destroy() is going to be called

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant