Here is what I get here, starting the program from a terminal:
[roland@localhost textextent]$ ./project1
// After clicking on the button:
(project1:30355): GLib-GObject-CRITICAL **: 06:53:29.357: g_object_unref: assertion 'G_IS_OBJECT (object)' failed
// x 19
// After closing the application:
[TGtk2WidgetSet.Destroy] WARNING: There are 1 unreleased DCs, a detailed dump follows:
[TGtk2WidgetSet.Destroy] DCs: 00007FE0CE51C440
[TGtk2WidgetSet.Destroy] WARNING: There are 2 unreleased GDIObjects, a detailed dump follows:
[TGtk2WidgetSet.Destroy] GDIOs: 00007FE0CE97C440 00007FE0CE97C1C0
[TGtk2WidgetSet.Destroy] gdiBitmap: 2
(project1:30355): GLib-GObject-CRITICAL **: 06:53:37.285: g_object_unref: assertion 'G_IS_OBJECT (object)' failed
[roland@localhost textextent]$