http://bugs.winehq.org/show_bug.cgi?id=58211 --- Comment #4 from Michael <micetym@gmail.com> --- Clicking anywhere in a TreeView whose owner rebuilds the tree from its NM_CLICK handler aborts the process: Assertion failed: newSelect == NULL || TREEVIEW_ValidItem(infoPtr, newSelect), file dlls/comctl32/treeview.c, line 4621 TREEVIEW_LButtonDown() computes ht.hItem via the hit test, then sends NM_CLICK to the application. The application may modify the tree from that handler, freeing the item ht.hItem refers to. ht.hItem is then passed unchecked to TREEVIEW_DoSelectItem(), whose entry assert aborts. TREEVIEW_SelectItem() (the TVM_SELECTITEM handler) already guards the same call with TREEVIEW_ValidItem() and returns FALSE for a stale handle; the mouse path does not. The code is unchanged in current master. Reproduced with Notepad++ 8.9.3 and the NppFTP plugin: the plugin populates its profile tree lazily, and the first click in the panel - on an entry or on empty space alike - kills Notepad++. Scrolling the list to the end and back first fully populates the tree, after which clicking is harmless; that timing dependency matches the analysis above. Attaching a trimmed log and a suggested four-line patch. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.