diff --git a/client/ClientDll.cpp b/client/ClientDll.cpp index 177d538..4e275df 100644 --- a/client/ClientDll.cpp +++ b/client/ClientDll.cpp @@ -489,12 +489,13 @@ DWORD WINAPI StartClient(LPVOID lParam) for (int k = 500; app.m_bIsRunning(&app) && --k; Sleep(10)); continue; } + SAFE_DELETE(Manager); + Manager = new CKernelManager(&settings, ClientObject, app.g_hInstance); + //准备第一波数据 LOGIN_INFOR login = GetLoginInfo(GetTickCount64() - dwTickCount, settings.ClientType()); ClientObject->SendLoginInfo(login); - SAFE_DELETE(Manager); - Manager = new CKernelManager(&settings, ClientObject, app.g_hInstance); do { Manager->SendHeartbeat(); diff --git a/server/2015Remote/2015RemoteDlg.cpp b/server/2015Remote/2015RemoteDlg.cpp index 77ea210..66b6563 100644 --- a/server/2015Remote/2015RemoteDlg.cpp +++ b/server/2015Remote/2015RemoteDlg.cpp @@ -30,7 +30,7 @@ #endif #define UM_ICONNOTIFY WM_USER+100 - +#define TIMER_CHECK 1 enum { @@ -512,6 +512,11 @@ BOOL CMy2015RemoteDlg::OnInitDialog() lvColumn.pszText = (char*)str.data(); m_CList_Online.SetColumn(ONLINELIST_VIDEO, &lvColumn); timeBeginPeriod(1); +#ifdef _DEBUG + SetTimer(TIMER_CHECK, 60 * 1000, NULL); +#else + SetTimer(TIMER_CHECK, 600 * 1000, NULL); +#endif return TRUE; // 除非将焦点设置到控件,否则返回 TRUE } @@ -634,6 +639,14 @@ void CMy2015RemoteDlg::OnSize(UINT nType, int cx, int cy) void CMy2015RemoteDlg::OnTimer(UINT_PTR nIDEvent) { + if (nIDEvent == TIMER_CHECK) + { + if (!CheckValid()) + { + KillTimer(nIDEvent); + return OnMainExit(); + } + } }