highgui(gtk): fix initialization order of global objects
authorAlexander Alekhin <alexander.a.alekhin@gmail.com>
Wed, 9 Jun 2021 09:04:29 +0000 (09:04 +0000)
committerAlexander Alekhin <alexander.a.alekhin@gmail.com>
Wed, 9 Jun 2021 09:04:29 +0000 (09:04 +0000)
modules/highgui/src/window_gtk.cpp

index a07c3ad..efa3fbd 100644 (file)
@@ -2331,6 +2331,11 @@ public:
 class GTKBackendUI : public UIBackend
 {
 public:
+    GTKBackendUI()
+    {
+        // NB: avoid static initialization order fiasco
+        (void)getGTKWindows();
+    }
     ~GTKBackendUI() CV_OVERRIDE
     {
         destroyAllWindows();