use strict;
use warnings;
use Gtk2 '-init';

for (;;) {
  my $window = Gtk2::Gdk::Window -> new(undef, { window_type => 'toplevel', });
  $window->destroy;

  while (Gtk2->events_pending) {
    Gtk2->main_iteration_do(0);
  }

  undef $window;
}
