set _ptr to nullptr after reset()
This commit is contained in:
parent
50d3ab6bba
commit
a1ef65b71c
|
@ -1,6 +1,6 @@
|
|||
cmake_minimum_required (VERSION 3.7)
|
||||
project (expandurl-mastodon
|
||||
VERSION 0.8.1
|
||||
VERSION 0.8.2
|
||||
LANGUAGES CXX
|
||||
)
|
||||
|
||||
|
|
|
@ -85,9 +85,10 @@ const void Listener::read_config()
|
|||
|
||||
const void Listener::start()
|
||||
{
|
||||
static std::uint_fast16_t ret = 0;
|
||||
static std::uint_fast16_t ret;
|
||||
_thread = std::thread([=]
|
||||
{
|
||||
ret = 0;
|
||||
_running = true;
|
||||
Easy masto(_instance, _access_token);
|
||||
masto.set_useragent(static_cast<const string>("expandurl-mastodon/") +
|
||||
|
@ -103,7 +104,7 @@ const void Listener::start()
|
|||
}
|
||||
_running = false;
|
||||
});
|
||||
while (_ptr == nullptr)
|
||||
while (!_ptr)
|
||||
{
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(100));
|
||||
}
|
||||
|
@ -125,6 +126,7 @@ const void Listener::stop()
|
|||
_ptr->cancel_stream();
|
||||
_thread.join();
|
||||
_ptr.reset();
|
||||
_ptr = nullptr;
|
||||
_stream = "";
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue
Block a user