mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-03 21:50:42 +08:00
Timer unique pointer
This commit is contained in:
parent
f1261f8e01
commit
292885e9d1
@ -177,8 +177,8 @@ UserAccountCommunication::UserAccountCommunication(wxEvtHandler* evt_handler, Ap
|
||||
: wxEvtHandler()
|
||||
, m_evt_handler(evt_handler)
|
||||
, m_app_config(app_config)
|
||||
, m_polling_timer(new wxTimer(this))
|
||||
, m_token_timer(new wxTimer(this))
|
||||
, m_polling_timer(std::make_unique<wxTimer>(this))
|
||||
, m_token_timer(std::make_unique<wxTimer>(this))
|
||||
{
|
||||
Bind(wxEVT_TIMER, &UserAccountCommunication::on_token_timer, this, m_token_timer->GetId());
|
||||
Bind(wxEVT_TIMER, &UserAccountCommunication::on_polling_timer, this, m_polling_timer->GetId());
|
||||
@ -225,12 +225,7 @@ UserAccountCommunication::UserAccountCommunication(wxEvtHandler* evt_handler, Ap
|
||||
UserAccountCommunication::~UserAccountCommunication()
|
||||
{
|
||||
m_token_timer->Stop();
|
||||
delete m_token_timer;
|
||||
m_token_timer = nullptr;
|
||||
|
||||
m_polling_timer->Stop();
|
||||
delete m_polling_timer;
|
||||
m_polling_timer = nullptr;
|
||||
|
||||
if (m_thread.joinable()) {
|
||||
// Stop the worker thread, if running.
|
||||
|
@ -86,7 +86,7 @@ private:
|
||||
bool m_thread_stop { false };
|
||||
bool m_thread_wakeup{ false };
|
||||
bool m_window_is_active{ true };
|
||||
wxTimer* m_polling_timer;
|
||||
std::unique_ptr<wxTimer> m_polling_timer;
|
||||
|
||||
std::string m_code_verifier;
|
||||
wxEvtHandler* m_evt_handler;
|
||||
@ -95,7 +95,7 @@ private:
|
||||
std::string m_username;
|
||||
bool m_remember_session { true }; // if default is true, on every login Remember me will be checked.
|
||||
|
||||
wxTimer* m_token_timer;
|
||||
std::unique_ptr<wxTimer> m_token_timer;
|
||||
std::time_t m_next_token_refresh_at{0};
|
||||
|
||||
void wakeup_session_thread();
|
||||
|
Loading…
x
Reference in New Issue
Block a user