From f5a8f04d732622a3fad59654d57639cca224abcd Mon Sep 17 00:00:00 2001 From: tastytea Date: Wed, 6 Jun 2018 21:17:10 +0200 Subject: [PATCH] make surer config file is written on shutdown --- CMakeLists.txt | 2 +- src/masto.cpp | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7779f79..c2607c1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required (VERSION 3.7) project (expandurl-mastodon - VERSION 0.9.4 + VERSION 0.9.5 LANGUAGES CXX ) diff --git a/src/masto.cpp b/src/masto.cpp index 9c4805f..0d776a5 100644 --- a/src/masto.cpp +++ b/src/masto.cpp @@ -66,11 +66,6 @@ Listener::Listener() Listener::~Listener() { - if (!configfile.write()) - { - syslog(LOG_ERR, "Could not write %s.", - configfile.get_filepath().c_str()); - } } const void Listener::read_config() @@ -122,6 +117,12 @@ const void Listener::start() const void Listener::stop() { + if (!configfile.write()) + { + syslog(LOG_ERR, "Could not write %s.", + configfile.get_filepath().c_str()); + } + if (_ptr) { _ptr->cancel_stream();