From 7b5c945859e92b1921313da3bbd5dc332ac62910 Mon Sep 17 00:00:00 2001
From: George Hazan <ghazan@miranda.im>
Date: Fri, 31 Mar 2017 12:34:45 +0300
Subject: couple of memleak fixes

---
 src/mir_core/src/subclass.cpp | 3 +++
 1 file changed, 3 insertions(+)

(limited to 'src/mir_core')

diff --git a/src/mir_core/src/subclass.cpp b/src/mir_core/src/subclass.cpp
index f917646bb7..9188ad60aa 100644
--- a/src/mir_core/src/subclass.cpp
+++ b/src/mir_core/src/subclass.cpp
@@ -58,6 +58,9 @@ static LRESULT CALLBACK MSubclassWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LP
 
 MIR_CORE_DLL(void) mir_subclassWindow(HWND hWnd, WNDPROC wndProc)
 {
+	if (hWnd == nullptr)
+		return;
+
 	MSubclassData *p = arSubclass.find((MSubclassData*)&hWnd);
 	if (p == NULL) {
 		p = new MSubclassData;
-- 
cgit v1.2.3