From 1112092cb2df0d7d2006e6ced5ab48cf7308635a Mon Sep 17 00:00:00 2001 From: tastytea Date: Sun, 20 May 2018 11:07:38 +0200 Subject: [PATCH] reconnect: quick & dirty fix --- CMakeLists.txt | 2 +- src/main.cpp | 1 + src/masto.cpp | 5 ++++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 24b9021..5b305ff 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required (VERSION 3.7) project (expandurl-mastodon - VERSION 0.3.3 + VERSION 0.3.4 LANGUAGES CXX ) diff --git a/src/main.cpp b/src/main.cpp index efd2791..e8a7b3a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -64,6 +64,7 @@ int main(int argc, char *argv[]) cout << "DEBUG: Reestablishing connection...\n"; listener.stop(); listener.start(); + cout << "DEBUG: Reestablished connection.\n"; } for (Easy::Notification ¬if : listener.get_new_messages()) diff --git a/src/masto.cpp b/src/masto.cpp index fb06748..464755a 100644 --- a/src/masto.cpp +++ b/src/masto.cpp @@ -77,7 +77,10 @@ const void Listener::stop() if (_ptr) { _ptr->cancel_stream(); - _thread.join(); + if (_running) + { + _thread.join(); + } _ptr.reset(); _stream = ""; }