summaryrefslogtreecommitdiff
path: root/plugins/TabSRMM/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2019-09-18 13:17:35 +0300
committerGeorge Hazan <ghazan@miranda.im>2019-09-18 13:17:35 +0300
commit8b4cf23b3aca667aba5429ee9e5b45b578db71d7 (patch)
treeb2819366f56bcec673b2233951750dbccba43f6e /plugins/TabSRMM/src
parentac297d39f72433e077396a02c71526d50b157b17 (diff)
fixes #2068 (crash in Window7 taskbar preview)
Diffstat (limited to 'plugins/TabSRMM/src')
-rw-r--r--plugins/TabSRMM/src/msgdialog.cpp2
-rw-r--r--plugins/TabSRMM/src/taskbar.cpp14
-rw-r--r--plugins/TabSRMM/src/taskbar.h8
3 files changed, 12 insertions, 12 deletions
diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp
index 8f3daf9d19..bde2b28a3f 100644
--- a/plugins/TabSRMM/src/msgdialog.cpp
+++ b/plugins/TabSRMM/src/msgdialog.cpp
@@ -376,8 +376,6 @@ void CMsgDialog::Init()
CMsgDialog::~CMsgDialog()
{
- delete m_pWnd;
-
mir_free(m_sendBuffer);
mir_free(m_hHistoryEvents);
mir_free(m_hQueuedEvents);
diff --git a/plugins/TabSRMM/src/taskbar.cpp b/plugins/TabSRMM/src/taskbar.cpp
index 7f8d9ab86c..7e87787958 100644
--- a/plugins/TabSRMM/src/taskbar.cpp
+++ b/plugins/TabSRMM/src/taskbar.cpp
@@ -184,10 +184,8 @@ void CMsgDialog::VerifyProxy()
if (IsWinVer7Plus() && PluginConfig.m_useAeroPeek) {
if (nullptr == m_pWnd) {
m_pWnd = new CProxyWindow(this);
- if (m_pWnd) {
- m_pWnd->updateIcon(m_hTabStatusIcon);
- m_pWnd->updateTitle(m_cache->getNick());
- }
+ m_pWnd->updateIcon(m_hTabStatusIcon);
+ m_pWnd->updateTitle(m_cache->getNick());
}
else m_pWnd->verifyDwmState();
}
@@ -210,6 +208,9 @@ void CMsgDialog::VerifyProxy()
CProxyWindow::CProxyWindow(CMsgDialog *dat) :
m_dat(dat)
{
+ if (m_dat == nullptr)
+ DebugBreak();
+
m_hwndProxy = ::CreateWindowEx(/*WS_EX_TOOLWINDOW | */WS_EX_NOACTIVATE, PROXYCLASSNAME, L"",
WS_POPUP | WS_BORDER | WS_SYSMENU | WS_CAPTION, -32000, -32000, 10, 10, nullptr, nullptr, g_plugin.getInst(), (LPVOID)this);
@@ -518,8 +519,9 @@ LRESULT CALLBACK CProxyWindow::wndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARA
{
switch (msg) {
case WM_CLOSE:
- SendMessage(m_dat->GetHwnd(), WM_CLOSE, 1, 2);
- {
+ if (m_dat) {
+ SendMessage(m_dat->GetHwnd(), WM_CLOSE, 1, 2);
+
TContainerData *pC = m_dat->m_pContainer;
if (!IsIconic(pC->m_hwnd))
SetForegroundWindow(pC->m_hwnd);
diff --git a/plugins/TabSRMM/src/taskbar.h b/plugins/TabSRMM/src/taskbar.h
index 622ec3cff9..3ee461ff1a 100644
--- a/plugins/TabSRMM/src/taskbar.h
+++ b/plugins/TabSRMM/src/taskbar.h
@@ -95,7 +95,7 @@ private:
virtual void renderContent() override;
};
-class CProxyWindow
+class CProxyWindow : public MZeroedObject
{
public:
CProxyWindow(CMsgDialog *dat);
@@ -121,15 +121,15 @@ public:
private:
CMsgDialog *m_dat;
- HWND m_hwndProxy = nullptr;
+ HWND m_hwndProxy;
LONG m_width, m_height;
- HICON m_hBigIcon = nullptr, m_hOverlayIcon = nullptr;
+ HICON m_hBigIcon, m_hOverlayIcon;
LRESULT CALLBACK wndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
void sendThumb(LONG width, LONG height);
void sendPreview();
- CThumbBase *m_thumb = nullptr;
+ CThumbBase *m_thumb;
};
class CTaskbarInteract