mirror of
https://github.com/henrypp/simplewall.git
synced 2026-10-23 11:32:32 -05:00
fixed timer cleanup
This commit is contained in:
1 file changed
+9
-7
+9
-7
@@ -3,7 +3,7 @@
|
||||
|
||||
#include "global.hpp"
|
||||
|
||||
void _app_timer_create (HWND hwnd, const MFILTER_APPS* ptr_apps, time_t seconds)
|
||||
void _app_timer_create (HWND hwnd, const MFILTER_APPS *ptr_apps, time_t seconds)
|
||||
{
|
||||
if (!config.hengine || !ptr_apps || ptr_apps->empty ())
|
||||
return;
|
||||
@@ -19,8 +19,8 @@ void _app_timer_create (HWND hwnd, const MFILTER_APPS* ptr_apps, time_t seconds)
|
||||
|
||||
if (ptr_app->htimer)
|
||||
{
|
||||
DeleteTimerQueueTimer (config.htimer, ptr_app->htimer, nullptr);
|
||||
ptr_app->htimer = nullptr;
|
||||
if (DeleteTimerQueueTimer (config.htimer, ptr_app->htimer, nullptr))
|
||||
ptr_app->htimer = nullptr;
|
||||
}
|
||||
|
||||
if (ptr_app->timer)
|
||||
@@ -50,7 +50,7 @@ void _app_timer_create (HWND hwnd, const MFILTER_APPS* ptr_apps, time_t seconds)
|
||||
_wfp_create3filters (ptr_apps, __LINE__);
|
||||
}
|
||||
|
||||
size_t _app_timer_remove (HWND hwnd, const MFILTER_APPS* ptr_apps)
|
||||
size_t _app_timer_remove (HWND hwnd, const MFILTER_APPS *ptr_apps)
|
||||
{
|
||||
if (!config.hengine || !ptr_apps || ptr_apps->empty ())
|
||||
return false;
|
||||
@@ -72,9 +72,11 @@ size_t _app_timer_remove (HWND hwnd, const MFILTER_APPS* ptr_apps)
|
||||
|
||||
if (ptr_app->htimer)
|
||||
{
|
||||
DeleteTimerQueueTimer (config.htimer, ptr_app->htimer, nullptr);
|
||||
ptr_app->htimer = nullptr;
|
||||
ptr_app->timer = 0;
|
||||
if (DeleteTimerQueueTimer (config.htimer, ptr_app->htimer, nullptr))
|
||||
{
|
||||
ptr_app->htimer = nullptr;
|
||||
ptr_app->timer = 0;
|
||||
}
|
||||
|
||||
ptr_app->is_enabled = false;
|
||||
|
||||
|
||||
Reference in new issue
Block a user