Reasons for FreePicture to cause "RenderBadPicture"?

Michel Dänzer michel at
Sat Aug 28 01:58:41 PDT 2010

On Fre, 2010-08-27 at 21:43 +0200, Clemens Eisserer wrote: 
> Hi again,
> Seems I have found the cause of the problem: Freeing Pictures that
> belong to an already destroyed window cause the RenderBadPicture
> error. The XID values in the error-log were wrong and therefor
> misleading.
> What puzzles me is the inconsistent behaviour:
> When a Window is destroyed, all its associated Pictures are freed,
> however this is not the case for Pixmaps.
> Even after calling XFreePixmap the assiciated Picture-Objects stay alive.

Pixmaps are reference-counted and the picture takes a reference on the
pixmap, so the pixmap can't go away before the picture.

However this isn't true for windows, so as soon as the window is
destroyed presumably the picture is destroyed as well or becomes
invalid. If you can't avoid using window pictures, it's probably best to
make sure you destroy any pictures before the windows themselves.

Earthling Michel Dänzer           |      
Libre software enthusiast         |          Debian, X and DRI developer

More information about the xorg mailing list