From 80238880e66c2210daa5d67b2dff60ac4a599c8c Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Wed, 9 Jun 2021 09:04:29 +0000 Subject: [PATCH] highgui(gtk): fix initialization order of global objects --- modules/highgui/src/window_gtk.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/highgui/src/window_gtk.cpp b/modules/highgui/src/window_gtk.cpp index a07c3ad5cc..efa3fbd96f 100644 --- a/modules/highgui/src/window_gtk.cpp +++ b/modules/highgui/src/window_gtk.cpp @@ -2331,6 +2331,11 @@ public: class GTKBackendUI : public UIBackend { public: + GTKBackendUI() + { + // NB: avoid static initialization order fiasco + (void)getGTKWindows(); + } ~GTKBackendUI() CV_OVERRIDE { destroyAllWindows();