Code:
alias testcrash dcc chat 127.0.0.1:1 | dcc chat 127.0.0.1:1
On *:close:=: window -c =$nick

Above script tested approximately thousand times on two PCs :

mIRC v6.16 - Pentium 4 "Northwood" 2.66GHz; 512m RAM; Windows 2K Pro => no crash
mIRC v6.16 - AMD Athlon "Thunderbird" 1.40GHz; 640m RAM; Windows 2K Pro => no crash