Firefox, Flashblock and Xorg (Linux)

Recently I've been having this problem, where on my Linux box, I'd get errors like this:

Xlib: Maximum number of clients reached

Looking in /proc/<PID of Xorg process>/fd shows that I'm at 257 open file descriptors. Poking around using various tools, lsof, xrestop etc., I tracked this down to my Firefox browser process. Killing it, cleans up about 220 file descriptors. This can't be right ... So, more debugging.

I've had problems with Firefox crashing frequently, particularly on some Flash enabled sites (and ads), so I recently installed the Flashblock extension. I used to run my Firefox with at least 4-5 extension, but since it's so incredibly unstable, I now run FF with a minimal number of extensions (which helps a lot). So, it was pretty obvious that Flashblock was causing this, and disabling this extension definitely solves the problem.

I haven't had a chance to examine the code in Flashblock, to see if it is responsible for leaking these file descriptors, or if it's some interaction with the Flash player plugin.