zeroshade commented on issue #1306: URL: https://github.com/apache/arrow-adbc/issues/1306#issuecomment-1828163409
> Is there any reason to use runtime.SetFinalizer? The idea was to ensure that if they didn't call `Close` on the database, we still clean up everything and avoid the memory leak via the GC triggering the finalizer. It also seems like it would be a bug for the `defer Close` to run *after* the finalizer, that would mean that the `db` object is getting cleaned up before the defer is run, which shouldn't happen because the statement should have a reference to the connector, which itself should have a reference to the db object, keeping it alive. Given the situation, I'd be fine with moving the logic to the close method of the `Database` object. Feel free to file the PR and I'll give it a review. > Besides that, it seems calling AdbcStatementRelease after AdbcDatabaseRelease results in segmentation violation On the one hand, it makes sense. On the other, we should be more graceful than this. When i have some time, I'll take a look and see if i can make this a bit more graceful. Feel free to give it a try yourself if you have the time before I do :smile: -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
