I'm assigning this based on CVS Blame on the second part of the problem (warren) and cc:ing beard since he shows up in CVS blame for the first part. nsIThread::SetMainThread leaks an nsThread because it is storing the main thread in a global variable. SetMainThread is called only from NS_InitXPCOM, so *if* this thread could be released in NS_ShutdownXPCOM, then that would fix one of the two extra references. Actually, though, it seems like the thread is addref'd twice in nsIThread::GetIThread. It seems that nsIThread::GetIThread is called only from SetMainThread (based on LXR), so I'm not sure if this is necessary, but it's not clear to me why it was done. Not addref-ing it twice in GetIThread would actually fix the leak, since there are two outstanding references, although the correct solution could easily be something else. A refcount balancer long (with ignore-balanced) is available, when my computer is on, at http://dbaron.student.harvard.edu/u/david/leaks/viewer/nsThread.balance-ib.txt
Is it that the xpcom shutdown doesn't free the main thread, or that the main thread is declared joinable, and no one ever joins with it? (I haven't investigated yet, but I thought I'd ask.)
Moving non-essential, non-beta2 and performance-related bugs to M17.
Moving Warren's thread bugs from his circular file to mine, because I was told it was the thing to do. Anyone who actually wants these bugs, now, feel free to correct my hastiness.
I think something fixed the observable leak here a long time ago.
Bugs targeted at mozilla1.0 without the mozilla1.0 keyword moved to mozilla1.0.1 (you can query for this string to delete spam or retrieve the list of bugs I've moved)