Glade crash in Ubuntu

There is a strange crash with glade program which manifests with crash in certain Ubuntu and Debian systems. The error message is something like this:
(glade:572424): Gdk-ERROR **: 23:45:43.580: The program 'glade' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadWindow (invalid Window parameter)'.
  (Details: serial 2143 error_code 3 request_code 20 (core protocol) minor_code 0)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the GDK_SYNCHRONIZE environment
   variable to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)
Trace/breakpoint trap (core dumped)
    
The quick fix is to wrap glade with a script in your own bin directory:
#! /bin/sh
exec env GTK_MODULES= /usr/bin/glade ${1+"$@"}