@bellenot thanks for all the explanations.
It seems I fixed most of problems in my code, but then I came across a segfault in TRootEmbeddedCanvas
destructor that you can observe in the new example: gui.tar.gz (1.3 KB)
Is it a bug somewhere (e.g. wrong sequence of automatic destruction) or am I doing something wrong?