comctl32: Respect an assert in TREEVIEW_RemoveAllChildren.
authorBruno Jesus <00cpxxx@gmail.com>
Mon, 23 Nov 2015 13:47:56 +0000 (21:47 +0800)
committerAlexandre Julliard <julliard@winehq.org>
Mon, 23 Nov 2015 15:25:02 +0000 (00:25 +0900)
Signed-off-by: Bruno Jesus <00cpxxx@gmail.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
dlls/comctl32/treeview.c

index 6adafc46b2f4c51b7e854edd3af5894d4781f4dd..dc196555ffbbff27c8a05a055cf34d35b5473dcc 100644 (file)
@@ -1441,11 +1441,13 @@ TREEVIEW_RemoveAllChildren(TREEVIEW_INFO *infoPtr, const TREEVIEW_ITEM *parentIt
 static void
 TREEVIEW_UnlinkItem(const TREEVIEW_ITEM *item)
 {
-    TREEVIEW_ITEM *parentItem = item->parent;
+    TREEVIEW_ITEM *parentItem;
 
     assert(item != NULL);
     assert(item->parent != NULL); /* i.e. it must not be the root */
 
+    parentItem = item->parent;
+
     if (parentItem->firstChild == item)
        parentItem->firstChild = item->nextSibling;