diff options
author | George Hazan <george.hazan@gmail.com> | 2014-05-10 08:28:12 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-05-10 08:28:12 +0000 |
commit | 2d5679d79f16628fdc2f4b9f420817b6c3c1c6b1 (patch) | |
tree | 3430c100a142e5e5de6b478737004dca58ec1ef6 /plugins/PluginUpdater | |
parent | c197e5206839d1fb1378d52d76df5681a80bd1eb (diff) |
fix for sharing the same global variable between two modules
git-svn-id: http://svn.miranda-ng.org/main/trunk@9154 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/PluginUpdater')
-rw-r--r-- | plugins/PluginUpdater/src/Common.h | 4 | ||||
-rw-r--r-- | plugins/PluginUpdater/src/DlgListNew.cpp | 8 | ||||
-rw-r--r-- | plugins/PluginUpdater/src/DlgUpdate.cpp | 7 | ||||
-rw-r--r-- | plugins/PluginUpdater/src/Events.cpp | 4 | ||||
-rw-r--r-- | plugins/PluginUpdater/src/Notifications.cpp | 1 | ||||
-rw-r--r-- | plugins/PluginUpdater/src/Version.h | 2 |
6 files changed, 21 insertions, 5 deletions
diff --git a/plugins/PluginUpdater/src/Common.h b/plugins/PluginUpdater/src/Common.h index 0025df82d2..3785594d4a 100644 --- a/plugins/PluginUpdater/src/Common.h +++ b/plugins/PluginUpdater/src/Common.h @@ -127,11 +127,13 @@ extern PlugOptions opts; extern POPUP_OPTIONS PopupOptions;
extern aPopups PopupsList[POPUPS];
extern HANDLE Timer, hPipe;
-extern HWND hwndDialog;
void DoCheck(int iFlag);
void DoGetList(int iFlag);
+void UninitCheck(void);
+void UninitListNew(void);
+
struct AutoHandle
{
HANDLE &m_handle;
diff --git a/plugins/PluginUpdater/src/DlgListNew.cpp b/plugins/PluginUpdater/src/DlgListNew.cpp index 1f3696c392..eded09dc1e 100644 --- a/plugins/PluginUpdater/src/DlgListNew.cpp +++ b/plugins/PluginUpdater/src/DlgListNew.cpp @@ -19,6 +19,8 @@ Boston, MA 02111-1307, USA. #include "common.h"
+static HWND hwndDialog;
+
static void SelectAll(HWND hDlg, bool bEnable)
{
OBJLIST<FILEINFO> &todo = *(OBJLIST<FILEINFO> *)GetWindowLongPtr(hDlg, GWLP_USERDATA);
@@ -458,3 +460,9 @@ void DoGetList(int iFlag) else if (iFlag)
hListThread = mir_forkthread(GetList, 0);
}
+
+void UninitListNew()
+{
+ if (hwndDialog != NULL)
+ DestroyWindow(hwndDialog);
+}
diff --git a/plugins/PluginUpdater/src/DlgUpdate.cpp b/plugins/PluginUpdater/src/DlgUpdate.cpp index a0909607df..ebef698ea5 100644 --- a/plugins/PluginUpdater/src/DlgUpdate.cpp +++ b/plugins/PluginUpdater/src/DlgUpdate.cpp @@ -22,6 +22,7 @@ Boston, MA 02111-1307, USA. #define UM_ERROR (WM_USER+1)
static bool bShowDetails;
+static HWND hwndDialog;
static void SelectAll(HWND hDlg, bool bEnable)
{
@@ -572,3 +573,9 @@ void DoCheck(int iFlag) hCheckThread = mir_forkthread(CheckUpdates, 0);
}
}
+
+void UninitCheck()
+{
+ if (hwndDialog != NULL)
+ DestroyWindow(hwndDialog);
+}
diff --git a/plugins/PluginUpdater/src/Events.cpp b/plugins/PluginUpdater/src/Events.cpp index 470390ad4f..cf1e72f868 100644 --- a/plugins/PluginUpdater/src/Events.cpp +++ b/plugins/PluginUpdater/src/Events.cpp @@ -90,7 +90,7 @@ int OnPreShutdown(WPARAM wParam, LPARAM lParam) CancelWaitableTimer(Timer);
CloseHandle(Timer);
- if (hwndDialog != NULL)
- DestroyWindow(hwndDialog);
+ UninitCheck();
+ UninitListNew();
return 0;
}
diff --git a/plugins/PluginUpdater/src/Notifications.cpp b/plugins/PluginUpdater/src/Notifications.cpp index 0076c923f1..2bbde5976e 100644 --- a/plugins/PluginUpdater/src/Notifications.cpp +++ b/plugins/PluginUpdater/src/Notifications.cpp @@ -20,7 +20,6 @@ Boston, MA 02111-1307, USA. #include "common.h"
HANDLE hPipe = NULL;
-HWND hwndDialog = NULL;
void PopupAction(HWND hWnd, BYTE action)
{
diff --git a/plugins/PluginUpdater/src/Version.h b/plugins/PluginUpdater/src/Version.h index 891e33d56f..9e347c0ead 100644 --- a/plugins/PluginUpdater/src/Version.h +++ b/plugins/PluginUpdater/src/Version.h @@ -1,7 +1,7 @@ #define __MAJOR_VERSION 0
#define __MINOR_VERSION 1
#define __RELEASE_NUM 1
-#define __BUILD_NUM 8
+#define __BUILD_NUM 9
#include <stdver.h>
|