| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
This is required per the documentation, otherwise can result in memory leaks due to unfreed resources.
|
@katafrakt Thanks for the PR. Reading the docs, this does sound like the right thing to do. Can I ask how you ran into this? Is there an easy way to reproduce the underlying failure conditions? I'd like to try to write a test and run it under valgrind/ASan to make sure memory leaks are all quashed. |
Sorry, something went wrong.
|
Ah - ignore my question, I see it's as easy as opening a nonexistent file. I'll try to put a test around this, but the change itself seems fine. Thanks! Worth noting: in the current codebase the memory is eventually cleaned up when the object is GCed, but this change would make that cleanup happen immediately which is definitely better. |
Sorry, something went wrong.
Specifically I want valgrind to be checking for correctness. Also add a changelog entry.
|
The story here is that I did not encounter this problem per se. I was making a similar fix for Elixir driver and checked how other drivers (Ruby, Python) handle this. I found out that Ruby has a similar problem as Elixir and decided to make a PR here as well. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Per documentation sqlite3_close_v2 should be called to free up resources even after sqlite3_open (and family) fails:
This is a bit verbose, because we need to get the message before closing and pass to CHECK_MSG. Alternative would be to keep using CHECK, but then a generic message would be printed.