>From 42e1dce5fe9f494803ffbbec0c435d9216c07bd7 Mon Sep 17 00:00:00 2001
From: Nikolay Sivov <nsivov@codeweavers.com>
Date: Wed, 8 Feb 2012 12:05:45 +0300
Subject: [PATCH 3/3] Invalidate before item is removed

---
 dlls/comctl32/tab.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/dlls/comctl32/tab.c b/dlls/comctl32/tab.c
index ad27b8a..f00ecd3 100644
--- a/dlls/comctl32/tab.c
+++ b/dlls/comctl32/tab.c
@@ -2879,14 +2879,13 @@ static LRESULT TAB_DeleteItem (TAB_INFO *infoPtr, INT iItem)
 
     if (iItem < 0 || iItem >= infoPtr->uNumItem) return FALSE;
 
+    TAB_InvalidateTabArea(infoPtr);
     item = TAB_GetItem(infoPtr, iItem);
     Free(item->pszText);
     Free(item);
     infoPtr->uNumItem--;
     DPA_DeletePtr(infoPtr->items, iItem);
 
-    TAB_InvalidateTabArea(infoPtr);
-
     if (infoPtr->uNumItem == 0)
     {
         if (infoPtr->iHotTracked >= 0)
-- 
1.5.6.5

