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

Destroy envhp with last dbh #93

Merged
merged 11 commits into from
Jul 8, 2019
Merged

Destroy envhp with last dbh #93

merged 11 commits into from
Jul 8, 2019

Conversation

djzort
Copy link
Collaborator

@djzort djzort commented Jun 22, 2019

Try this

CarstenGrohmann and others added 3 commits April 14, 2019 10:45
As the order of object destruction during "global destruction" is
undefined. DBI traces show that the global environment is freed in the
driver destruction process before all database connections are closed
and their resources freed. This causes the segfault in #65.

This change moved freeing of the global environment handle from the
destruction of the driver handle (dbd_dr_destroy()) to the destruction
of the database handle (dbd_db_destroy()).

This implementation closes the global environment handle during the DBI
shutdown process if the last database handle uses the global
environment handle.

If the last database handles uses a session environment handle, the
global environment handle will not be destroyed.
@djzort
Copy link
Collaborator Author

djzort commented Jun 22, 2019

See also #89

@djzort
Copy link
Collaborator Author

djzort commented Jun 24, 2019

I created this travis-perl/helpers#74

@mjegh mjegh merged commit 106b3fa into perl5-dbi:master Jul 8, 2019
@djzort djzort deleted the destroy_envhp_with_last_dbh branch July 9, 2019 01:39
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

Successfully merging this pull request may close these issues.

3 participants