diff options
author | dec05eba <dec05eba@protonmail.com> | 2018-11-04 03:44:11 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2018-11-04 03:44:14 +0100 |
commit | 905a9b962b1464cf2f293b21634d4aa665c009ab (patch) | |
tree | b543552b95aa98e643edbd1171a3ee05e5ea7a08 /src/Window.cpp | |
parent | c7138bca7ea7d007198c544b2d8bc27ae414d2e2 (diff) |
Fix crash when creating room when user is not a member of any other room
Diffstat (limited to 'src/Window.cpp')
-rw-r--r-- | src/Window.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/Window.cpp b/src/Window.cpp index b5a9f26..22e5501 100644 --- a/src/Window.cpp +++ b/src/Window.cpp @@ -1,6 +1,5 @@ #include "../include/Window.hpp" #include <dchat/RoomDataType.hpp> -#include "../include/WindowNotification.hpp" #include <dchat/Cache.hpp> #include <sibs/SafeDeserializer.hpp> #include <math.h> @@ -11,10 +10,11 @@ namespace dchat const int nodesPerColumn = 10; const int nodesPerRow = 10; - Window::Window() + Window::Window() : + chatWindow(this) { set_border_width(0); - WindowNotification *windowNotification = Gtk::manage(new WindowNotification()); + windowNotification = Gtk::manage(new WindowNotification()); overlay.add_overlay(*windowNotification); overlay.set_overlay_pass_through(*windowNotification); overlay.add(stack); @@ -31,7 +31,7 @@ namespace dchat //chatWindow.show_all(); //loginWindow.show(); - loginWindow.setLoginHandler([this, windowNotification](const Glib::ustring &username, const Glib::ustring &password) + loginWindow.setLoginHandler([this](const Glib::ustring &username, const Glib::ustring &password) { if(!rooms || !rooms->database) { @@ -57,7 +57,7 @@ namespace dchat } }); - loginWindow.setRegisterHandler([this, windowNotification](const Glib::ustring &username, const Glib::ustring &password) + loginWindow.setRegisterHandler([this](const Glib::ustring &username, const Glib::ustring &password) { if(!rooms || !rooms->database) { @@ -84,13 +84,13 @@ namespace dchat } }); - loginWindow.setRegisterPasswordMismatch([windowNotification] + loginWindow.setRegisterPasswordMismatch([this] { windowNotification->show("Passwords do not match"); }); RoomCallbackFuncs roomCallbackFuncs; - roomCallbackFuncs.connectCallbackFunc = [this, windowNotification](std::shared_ptr<Rooms> rooms, const char *errMsg) + roomCallbackFuncs.connectCallbackFunc = [this](std::shared_ptr<Rooms> rooms, const char *errMsg) { this->rooms = rooms; if(rooms) |