summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/WhenWasIt/src/WhenWasIt.cpp3
-rw-r--r--plugins/WhenWasIt/src/hooked_events.cpp29
2 files changed, 10 insertions, 22 deletions
diff --git a/plugins/WhenWasIt/src/WhenWasIt.cpp b/plugins/WhenWasIt/src/WhenWasIt.cpp
index effd2d632f..f6f2f739ad 100644
--- a/plugins/WhenWasIt/src/WhenWasIt.cpp
+++ b/plugins/WhenWasIt/src/WhenWasIt.cpp
@@ -144,9 +144,6 @@ extern "C" int __declspec(dllexport) Unload()
WindowList_Broadcast(hAddBirthdayWndsList, WM_CLOSE, 0, 0);
WindowList_Destroy(hAddBirthdayWndsList);
- Log("%s", "Killing timers ...");
- KillTimers();
-
Log("%s", "Unhooking events ...");
UnhookEvents();
diff --git a/plugins/WhenWasIt/src/hooked_events.cpp b/plugins/WhenWasIt/src/hooked_events.cpp
index a421260b7e..ebc715a279 100644
--- a/plugins/WhenWasIt/src/hooked_events.cpp
+++ b/plugins/WhenWasIt/src/hooked_events.cpp
@@ -24,10 +24,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define EXCLUDE_HIDDEN 1
#define EXCLUDE_IGNORED 2
-UINT_PTR hCheckTimer = NULL;
-UINT_PTR hDateChangeTimer = NULL;
+static UINT_PTR hCheckTimer = NULL;
+static UINT_PTR hDateChangeTimer = NULL;
+static int currentDay = 0;
-int currentDay;
static int OnTopToolBarModuleLoaded(WPARAM, LPARAM)
{
@@ -145,31 +145,22 @@ int RefreshContactListIcons(MCONTACT hContact)
int UpdateTimers()
{
- if (hCheckTimer) {
- KillTimer(NULL, hCheckTimer);
- hCheckTimer = NULL;
- }
-
- long interval = db_get_dw(NULL, ModuleName, "Interval", CHECK_INTERVAL);
- interval *= 1000 * 60 * 60; //go from miliseconds to hours
+ UINT interval = db_get_dw(NULL, ModuleName, "Interval", CHECK_INTERVAL);
+ interval *= (1000 * 60 * 60); //go from miliseconds to hours
hCheckTimer = SetTimer(NULL, 0, interval, OnCheckTimer);
if (!hDateChangeTimer)
- hDateChangeTimer = SetTimer(NULL, 0, 1000 * DATE_CHANGE_CHECK_INTERVAL, OnDateChangeTimer);
+ hDateChangeTimer = SetTimer(NULL, 0, (1000 * DATE_CHANGE_CHECK_INTERVAL), OnDateChangeTimer);
return 0;
}
int KillTimers()
{
- if (hCheckTimer) {
- KillTimer(NULL, hCheckTimer);
- hCheckTimer = NULL;
- }
+ KillTimer(NULL, hCheckTimer);
+ hCheckTimer = NULL;
- if (hDateChangeTimer) {
- KillTimer(NULL, hDateChangeTimer);
- hDateChangeTimer = NULL;
- }
+ KillTimer(NULL, hDateChangeTimer);
+ hDateChangeTimer = NULL;
return 0;
}