use arc for db connection

This commit is contained in:
yggverse 2024-09-22 12:30:32 +03:00
parent db43289e24
commit 998e3170fb
2 changed files with 6 additions and 5 deletions

View file

@ -1,6 +1,7 @@
mod browser;
use std::fs;
use std::sync::Arc;
use gtk::prelude::{ApplicationExt, ApplicationExtManual, GtkApplicationExt, GtkWindowExt};
@ -35,12 +36,12 @@ fn main() -> glib::ExitCode {
db.push("database.sqlite3");
let db = match sqlite::open(db) {
Ok(db) => db,
Ok(db) => Arc::new(db),
Err(e) => panic!("Failed to connect profile database: {e}"),
};
move |this| {
browser::new(&this, &db, 640, 480).widget.present();
browser::new(&this, db.clone(), 640, 480).widget.present();
}
});