From 5406ca7b15e35cb6ebafd7dddbb9fc2e295fae71 Mon Sep 17 00:00:00 2001 From: ouwou <26526779+ouwou@users.noreply.github.com> Date: Tue, 23 Feb 2021 02:51:04 -0500 Subject: fix some crashes - crash when assuming group dms have someone other than urself - crash from lifetime error with user note update --- windows/profile/userinfopane.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'windows/profile/userinfopane.cpp') diff --git a/windows/profile/userinfopane.cpp b/windows/profile/userinfopane.cpp index c88bc45..384f62c 100644 --- a/windows/profile/userinfopane.cpp +++ b/windows/profile/userinfopane.cpp @@ -176,10 +176,11 @@ ProfileUserInfoPane::ProfileUserInfoPane(Snowflake ID) }); auto &discord = Abaddon::Get().GetDiscordClient(); - discord.signal_note_update().connect([this](Snowflake id, std::string note) { + auto note_update_cb = [this](Snowflake id, std::string note) { if (id == UserID) m_note.SetNote(note); - }); + }; + discord.signal_note_update().connect(sigc::track_obj(note_update_cb, m_note)); auto fetch_note_cb = [this](const std::string ¬e) { m_note.SetNote(note); -- cgit v1.2.3