LCA-ActivityBrowser / activity-browser

GUI for brightway2
GNU Lesser General Public License v3.0
134 stars 50 forks source link

Always close thread-specific SQLite connections #1222

Closed mrvisscher closed 4 months ago

mrvisscher commented 5 months ago

Fixes an issue where thread-specific SQLite database connections persisted even after said thread was finished, resulting in undeletable projects and segmentation faults. Now, by using run_safely() instead of run() within a reimplemented ABThread, all connections are closed after a thread finishes work.

Probably interesting to you @haasad , as this relates to #1124 and enables us to use Python 3.10 as well.

Checklist

coveralls commented 5 months ago

Coverage Status

coverage: 50.857% (-0.001%) from 50.858% when pulling 026ad4bbc050cf3869daf631b6e52c8236e24fdb on mrvisscher:thread-database-closer into ebbc322da7beebacc5b198448c9ce2260a191972 on LCA-ActivityBrowser:master.

mrvisscher commented 5 months ago

Thanks for your comments and review @haasad, happy you're happy! 😄