OSDN Git Service

initialize the QGuiPlatformPlugin pointer in qt_guiPlatformPlugin() function
authorIvailo Monev <xakepa10@gmail.com>
Mon, 5 Jun 2023 02:31:38 +0000 (05:31 +0300)
committerIvailo Monev <xakepa10@gmail.com>
Mon, 5 Jun 2023 02:31:38 +0000 (05:31 +0300)
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
src/gui/kernel/qguiplatformplugin.cpp

index 80a2b03..1edfb43 100644 (file)
@@ -38,14 +38,15 @@ QT_BEGIN_NAMESPACE
 Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, platformLoader, (QString::fromLatin1("/gui_platform")))
 #endif
 
-/*! \internal
-    Return (an construct if necesseray) the Gui Platform plugin.
+/*!
+    \internal
+    Return (and constructs if necesseray) the Gui Platform plugin.
 
     If no plugin can be loaded, the default one is returned.
  */
 QGuiPlatformPlugin *qt_guiPlatformPlugin()
 {
-    static QGuiPlatformPlugin *plugin;
+    static QGuiPlatformPlugin *plugin = nullptr;
     if (!plugin)
     {
 #ifndef QT_NO_LIBRARY