Browse Source

use shared_ptr for db

CPP-GTK4
yggverse 3 months ago
parent
commit
3e38d69fb7
  1. 8
      src/main.cpp
  2. 1
      src/main.hpp

8
src/main.cpp

@ -7,7 +7,7 @@ int main( @@ -7,7 +7,7 @@ int main(
char * argv[]
) {
// Init app
auto app = Gtk::Application::create(
const Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(
"io.github.yggverse.Yoda"
);
@ -27,8 +27,10 @@ int main( @@ -27,8 +27,10 @@ int main(
);
// Init profile
auto db = lib::Database(
"database.sqlite3"
const std::shared_ptr<lib::Database> db(
new lib::Database(
"database.sqlite3"
)
);
// Launch browser component

1
src/main.hpp

@ -1,4 +1,5 @@ @@ -1,4 +1,5 @@
#include <glibmm.h>
#include <memory>
int main(
int argc,

Loading…
Cancel
Save