summaryrefslogtreecommitdiffstats
path: root/src/corelib/plugin
Commit message (Collapse)AuthorAgeFilesLines
* QFactoryLoader: de-duplicate two QStringLiteralsMarc Mutz2014-10-091-4/+8
| | | | | | | | | | | | When seemingly identical QStringLiterals are used in different functions, due to the use of lambdas and scoping, they produce different lambda types and thus duplicated QStringLiteral data. Fix by moving the QStringLiterals into inline functions and calling those instead. Change-Id: Ifaa124ec74e201ccc63fd9afce042f8b2ff22b9e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Doc: 2 minor corrections in corelib/pluginNico Vertriest2014-09-251-2/+2
| | | | | | Task-number: QTBUG-40362 Change-Id: I4fa4a69c13a60f8c7915b6c9659a4daaae4ecc1a Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* Update license headers and add new license filesMatti Paaso2014-09-2419-359/+207
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* Merge remote-tracking branch 'origin/5.3' into 5.4Frederik Gladhorn2014-09-231-0/+11
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The isAlwaysAskOption was removed in 38621713150b663355ebeb799a5a50d8e39a3c38 so manually removed code in src/plugins/bearer/connman/qconnmanengine.cpp Conflicts: src/corelib/global/qglobal.h src/corelib/tools/qcollator_macx.cpp src/corelib/tools/qstring.cpp src/gui/kernel/qwindow.cpp src/gui/kernel/qwindow_p.h src/gui/text/qtextengine.cpp src/platformsupport/fontdatabases/fontconfig/qfontenginemultifontconfig_p.h src/plugins/platforms/android/qandroidinputcontext.cpp src/plugins/platforms/xcb/qglxintegration.cpp src/plugins/platforms/xcb/qglxintegration.h src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/testlib/qtestcase.cpp src/testlib/qtestlog.cpp src/widgets/dialogs/qfiledialog.cpp src/widgets/kernel/qwindowcontainer.cpp tests/auto/corelib/tools/qcollator/tst_qcollator.cpp tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp Change-Id: Ic5d4187f682257a17509f6cd28d2836c6cfe2fc8
| * Add missing private headers warningSamuel Gaist2014-09-041-0/+11
| | | | | | | | | | Change-Id: I7a4dd22ea3bcebf4c3ec3ad731628fd8f3c247e0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Don't store QLibraryPrivate with empty file names in the global storeThiago Macieira2014-07-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | They shouldn't exist in the first place. They exist in two cases only: 1) mistake by the user in the QLibrary or QPluginLoader constructors or setFileName 2) as a kludge for setLoadHints before a file name is set (we need to store the user's requested hints somewhere) This is important for the second case, as otherwise all QLibrary and QPluginLoader objects without a file name would share the setting. Task-number: QTBUG-39642 Change-Id: Iebff0252fd4d95a1d54caf338d4e2fff4de3b189 Reviewed-by: David Faure <david.faure@kdab.com>
* | Fix a few more race conditions with QLibrary::LoadHintsThiago Macieira2014-07-234-22/+32
|/ | | | | | | | | | This commit makes replaces the loadHints member with a setter, a getter and an atomic variable. The setter will not set anything if the library has already been loaded. Task-number: QTBUG-39642 Change-Id: Ibb7692f16d80211b52aaf4dc88db1a989738a24d Reviewed-by: David Faure <david.faure@kdab.com>
* Move most of the QLibraryPrivate initialization to its constructorThiago Macieira2014-06-213-16/+32
| | | | | | | | | | | | | | This commit moves the setting of the loadHints to inside the constructor or to QLibraryStore::findOrCreate (which is under a mutex). This avoids data race conditions with two threads asking for the same plugin at the same time, with different load hints. This also opportunistically moves the setting of the error message for empty file names. Task-number: QTBUG-39642 Change-Id: I497a41781d10e407d6420116a0b05fdfe2b548de Reviewed-by: David Faure <david.faure@kdab.com>
* Move the hex digits out of _q_toHexThiago Macieira2014-05-141-2/+2
| | | | | | | | Avoids them being duplicated several times in QtCore Change-Id: Idee0168ed9d452a572ad46e2a14d2d4d3c7d2f7e Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* QNX: Work around dlclose issueBernd Weimer2014-04-091-0/+8
| | | | | | | | "Shared objects still referenced" dlerror should actually be treated as "for your information" only, not as an actual error. Change-Id: Ie02bd1db0dd2dc93bb759f8b6c7e825070e17bb9 Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
* Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2014-02-071-6/+15
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/gui/kernel/qguiapplication.cpp src/plugins/platforms/android/androidjnimain.cpp src/plugins/platforms/android/qandroidplatformintegration.cpp src/plugins/platforms/android/qandroidplatformintegration.h src/plugins/platforms/android/qandroidplatformopenglcontext.cpp src/plugins/platforms/cocoa/qcocoawindow.h src/plugins/platforms/cocoa/qcocoawindow.mm src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/sql/doc/src/sql-driver.qdoc src/widgets/widgets/qtoolbararealayout.cpp Change-Id: Ifd7e58760c3cb6bd8a7d1dd32ef83b7ec190d41e
| * Don't allow the QLibraryStore to be recreated during shutdownThiago Macieira2014-01-221-6/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When QtCore's global destructors are run, they delete the global QLibraryStore qt_library_data and set the pointer to null. If something happened to call QLibraryStore::instance() later, it would be recreated and then weird things might happen. So prevent that from happening. That usually cannot happen, since the only thing that can run after QtCore global destructors are other QtCore global destructors or global destructors from libraries that do not depend on QtCore. So we're reasonably safe. There are two conditions in which something could run after QLibraryStore::cleanup() and still try to access QLibraryStore: 1) indirect dependency, like a global destructor from a library that doesn't depend on QtCore running code from another module that does. 2) static builds of Qt modules. In that case, the order of the global destructors is totally arbitrary and we could get one from a module that depends on QtCore running after QtCore's. That is the case from the bug report. Task-number: QTBUG-36294 Change-Id: Id199671275fd2535acf2d158857ce46b474e579b Reviewed-by: Kai Koehne <kai.koehne@digia.com> Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
* | expand tabs and related whitespace fixes in *.{cpp,h,qdoc}Oswald Buddenhagen2014-01-131-1/+1
| | | | | | | | | | | | | | | | the diff -w for this commit is empty. Started-by: Thiago Macieira <thiago.macieira@intel.com> Change-Id: I77bb84e71c63ce75e0709e5b94bee18e3ce6ab9e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2014-01-101-1/+2
|\| | | | | | | Change-Id: I99af0bef7f1c931533a324ebcfb27c40ee871a5e
| * Ensure that the Qt5Core library does not contain "QTMETADATA ".Friedemann Kleint2014-01-091-1/+2
| | | | | | | | | | | | | | | | | | | | | | In the event the plugin loader encounters it due to some configuration problem, it is otherwise detected as a plugin causing a crash when trying to read the meta data. Task-number: QTBUG-35970 Change-Id: I34182b3a61125e3b192dfd4b1dc03bd1e98c693e Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-12-241-0/+1
|\| | | | | | | Change-Id: I2defae1904154283446b069d151c3ef57302ec7b
| * Doc: corrected broken linksNico Vertriest2013-12-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-34749 Corrected link to drag and drop example. Corrected link to {mandatory fields} Created target referring to macros for defining plugins Change-Id: I387a2d9bab428b2eacd8d371f08c72f42f7e2be2 Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-12-051-1/+1
|\| | | | | | | | | | | | | Conflicts: src/sql/drivers/sqlite/qsql_sqlite.cpp Change-Id: Ia7cffd2c99ae3d5eea6b5740683c06e921336dcd
| * Doc: fixed invalid referenceNico Vertriest2013-12-031-1/+1
| | | | | | | | | | | | | | | | | | | | Link to "Getting started with qmake" was invalid Task-number: QTBUG-34749 Change-Id: I782dc99f5182f2fe7661377eb82f35ebb50a46cf Reviewed-by: Martin Smith <martin.smith@digia.com> Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-11-261-2/+2
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For the conflicts in msvc_nmake.cpp the ifdefs are extended since we need to support windows phone in the target branch while it is not there in the current stable branch (as of Qt 5.2). Conflicts: configure qmake/generators/win32/msvc_nmake.cpp src/3rdparty/angle/src/libEGL/Surface.cpp src/angle/src/common/common.pri src/corelib/global/qglobal.h src/corelib/io/qstandardpaths.cpp src/plugins/platforms/qnx/qqnxintegration.cpp src/plugins/platforms/qnx/qqnxscreeneventhandler.h src/plugins/platforms/xcb/qglxintegration.h src/widgets/kernel/win.pri tests/auto/corelib/thread/qreadwritelock/tst_qreadwritelock.cpp tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp tools/configure/configureapp.cpp Change-Id: I00b579eefebaf61d26ab9b00046d2b5bd5958812
| * qcompilerdetection.h: add Q_COMPILER_UNIFORM_INITMarc Mutz2013-11-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Up to now, the feature classe Uniform Initialization was subsumed by the Q_COMPILER_INITIALIZER_LISTS flag together with support for std::initializer_list. This caused at least two problems: 1. On QNX, the standard libray does not ship <initializer_list>, even though the compiler (a GCC 4.6, IIRC) supports it. But since there was only one Q_COMPILER flag for both, support for the compiler-only part of the feature had to be disabled, too. 2. MSVC 2013 supports initializer lists, but has a bug that renders full uniform initialization support, as required for QUuid, useless. By splitting the feature into two, we can separate them better, and do so in QUuid, which is the only class that currently takes advantage of uniform initialization (to provide constexpr constructors). Since Q_COMPILER_INITIALIZER_LISTS worked as a flag for uniform initialization so far, with the two known exceptions above, UNIFORM_INIT is defined whenever INITIALIZER_LIST is, except that I don't revert UNIFORM_INIT on QNX as I do for INITIALIZER_LISTS and that I expect the MSVC 2013 features to set INITIALIZER_LIST, but not UNIFORM_INIT. Task-number: QTBUG-34705 Change-Id: I81916e950a0f3aab3de7977e0326d2de3d31b14c Reviewed-by: Yuchen Deng <loaden@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Refactor plugin loading for WinRTMaurice Kalinowski2013-11-051-1/+5
|/ | | | | | | | | | | | | | | | | Specify the root directory to be the package root. Only plugins inside the root can be opened (actually also only files). Furthermore current defaults to the package root now, which in most cases is identical to previous behavior. When attempting to load a plugin the path can either be specified in host format "C:/..." or as plugin absolute "/platforms/...". Check for both, with preference of latter case, like when qt.conf is used with / being used as plugin path. Change-Id: I7e3da293362488b62a3357c4882ebf5e048dcf95 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Andrew Knight <andrew.knight@digia.com> Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
* Doc: Adding mark-up to boolean default values.Jerome Pasion2013-10-083-25/+25
| | | | | | | | | | | | | | | | | Default values should have mark-up to denote that they are code. This commit changes: -"property is true" to "property is \c true". -"Returns true" to "Returns \c true". -"property is false" to "property is \c false". -"returns true" to "returns \c true". -"returns false" to "returns \c false". src/3rdparty and non-documentation instances were ignored. Task-number: QTBUG-33360 Change-Id: Ie87eaa57af947caa1230602b61c5c46292a4cf4e Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* WinRT: QLibrary & plugin supportAndrew Knight2013-09-202-1/+19
| | | | | | | | | | | | Avoid unsupported Win32 API while providing alternative codepaths for in-package library loading. Change-Id: Iaad059d6c94d0347cbaa8d9b9240806afcb29561 Done-with: Andrew Knight Done-with: Kamil Trzcinski Reviewed-by: Andrew Knight <andrew.knight@digia.com> Reviewed-by: Oliver Wolff <oliver.wolff@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* qpluginloader: fix static build (on iOS)Richard Moe Gustavsen2013-09-051-0/+2
| | | | | | | | | | Since the function locatePlugin is unused when building Qt statically, the build fails on iOS. This patch will ensure that we only define it for shared builds. Change-Id: Idf3c3246d3cac94a3c001cc261f326e9a396aa31 Reviewed-by: David Faure <david.faure@kdab.com>
* QPluginLoader: add 'staticPlugins' functionRichard Moe Gustavsen2013-09-045-15/+66
| | | | | | | | | | | | | | | | | | Currently there is no API to extract the meta data from static plugins. This is needed in e.g QtDeclarative for loading static module plugins. This patch moves the 'staticPlugins' function from QLibraryPrivate into QPluginLoader, and makes it public. As such, we now also export QStaticPlugin. Since an application developer cannot do much with raw metadata, we add a new function QStaticPlugin::metaData() that returns the QJsonObject for the plugin. The old metaData function is renamed 'rawMetaData'. Change-Id: Idb0bf9ad8ebb13340565512e1998b26e762a357e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-07-231-1/+2
|\ | | | | | | | | | | | | Conflicts: tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp Change-Id: I18a9d83fc14f4a9afdb1e40523ec51e3fa1d7754
| * Fix warning about using QString's const char* constructor on MacThiago Macieira2013-07-201-1/+2
| | | | | | | | | | Change-Id: I20ca50fdcdcfb075ad317247f147e4eb007a0c44 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* | Make the Mach-O size checking a little more robustThiago Macieira2013-07-201-20/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's not necessary to check at every point if we know the minimum file size: it must contain at least the header, one segment (__TEXT) and one section (qtmetadata). Most files have more than one segment and more than one loader command, so this check does not mean we can eliminate the checks further down. Also be more resilient against corruptions in the header data: check not only the additions, but the values themselves. For example, an offset + size addition could be smaller than the file size when the addition overflows in 32-bit. Another thing is that the cmdsize fields could be corrupt too. Change-Id: I7968a769c1cbe9150270c91823cafc4f8f833876 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Simplify the QLibrary plugin-detection codeThiago Macieira2013-07-201-104/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The reason why the scanning of files was restricted to Unix is lost in history. My guess is that it was added *because* on Unix you couldn't do the LoadLibrary trick to load without dependencies. That is, it makes no comparison to whether scanning is faster than LoadLibrary. So assume that scanning is faster, especially now that we have memory mapping in QFile (it wasn't there in Qt 4.0). This simplifies greatly the codebase because we no longer need to try to load and later unload the library to check whether it is a Qt plugin or not, nor deal with Windows non-C++ exceptions. Just scan on all platforms. Change-Id: If269e009bfb9920805ca1aa6c2b66aacdd5b26e9 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* | Add a Mach-O decoder to the QPluginLoaderThiago Macieira2013-07-204-6/+321
|/ | | | | | | | | | | | | | | | | | | | | | | We already had an ELF decoder, which helped us greatly to find the metadata and that catches most Unix systems (Solaris, QNX, HP-UXi, and all of the free Unixes). On other Unix systems, aside from Mac OS X, we simply scanned the entire file for the signature. On Windows, even without a COFF-PE decoder, we use a LoadLibrary trick to load the plugin without loading the dependent libraries. In most cases, that works. Unfortunately, on Mac OS X we didn't have a decoder and nor could we do the file scan: because Mac OS X binaries could be fat binaries, we wouldn't know which architecture's signature we had found. No more. This adds a full Mach-O decoder to QtCore. It is also capable of finding the boundaries of the architecture's binary, but that functionality is disabled since all Qt 5 plugins have plugin metadata sections. Change-Id: I2d5c04c5ecf024864b8a43f31ab6b7e6c5eae9ce Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge remote-tracking branch 'origin/release' into stableFrederik Gladhorn2013-06-201-10/+9
|\ | | | | | | Change-Id: I94bb158562ae6b80a87b40139d7302ea7b9b9aa8
| * QFactoryLoader: Release unused libraries.Friedemann Kleint2013-06-181-1/+6
| | | | | | | | | | | | | | Task-number: QTBUG-31476 Change-Id: Ib2eb076afaa21ab1fdc12944f80483e3de260d4b Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * Remove unused member QFactoryLoaderPrivate::keyList.Friedemann Kleint2013-06-181-9/+3
| | | | | | | | | | | | | | Task-number: QTBUG-31476 Change-Id: Ife9b25ede67837152d94cd500a1d7c6dc6cd8ab8 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Print directories for QT_DEBUG_PLUGINSKai Koehne2013-06-051-0/+4
|/ | | | | | | | So far we stayed completely silent if the user forgot to deploy all plugins, or deployed them in the wrong way. Change-Id: Idd776c4b4a2ddffd5da08985e5925248c97e0270 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Doc: added details for QRegisterStaticFunction(plugin)Nico Vertriest2013-04-191-1/+2
| | | | | | | | | Added reference to macro Q_IMPORT_PLUGIN() Task-number: QTBUG-30548 Change-Id: Ibc20ad52cd57d497f5a7fb5c4dd4a4c778e4a660 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* qdoc: Use Q_QDOC in quuid.h to help qdocMartin Smith2013-04-031-5/+5
| | | | | | | | | | | | | Some new ctor initializers were added that use curly braces. qdoc's dumb C++ parser can't handle curly braces in the ctor area; it thinks they are the body of the function. In this update, the Q_QDOC macro is used to isolate these problems so qdoc doesn't have to deal with them. Task-number: QTBUG-30254 Change-Id: Ie318e4ac58861f4ebd8a7b9f004d2677f850436e Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Merge branch 'dev' into stableOswald Buddenhagen2013-03-2010-91/+143
|\ | | | | | | | | | | | | | | | | | | | | | | This starts Qt 5.1 release cycle Conflicts: src/gui/text/qfontdatabase.cpp src/gui/text/qharfbuzz_copy_p.h src/widgets/kernel/qapplication.cpp src/widgets/kernel/qcoreapplication.cpp Change-Id: I72fbf83ab3c2206aeea1b089428b0fc2a89bd62b
| * Whitespace cleanup: remove trailing whitespaceAxel Waggershauser2013-03-161-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove all trailing whitespace from the following list of files: *.cpp *.h *.conf *.qdoc *.pro *.pri *.mm *.rc *.pl *.qps *.xpm *.txt *README excluding 3rdparty, test-data and auto generated code. Note A): the only non 3rdparty c++-files that still have trailing whitespace after this change are: * src/corelib/codecs/cp949codetbl_p.h * src/corelib/codecs/qjpunicode.cpp * src/corelib/codecs/qbig5codec.cpp * src/corelib/xml/qxmlstream_p.h * src/tools/qdoc/qmlparser/qqmljsgrammar.cpp * src/tools/uic/ui4.cpp * tests/auto/other/qtokenautomaton/tokenizers/* * tests/benchmarks/corelib/tools/qstring/data.cpp * util/lexgen/tokenizer.cpp Note B): in about 30 files some overlapping 'leading tab' and 'TAB character in non-leading whitespace' issues have been fixed to make the sanity bot happy. Plus some general ws-fixes here and there as asked for during review. Change-Id: Ia713113c34d82442d6ce4d93d8b1cf545075d11d Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
| * re-enable QT_NO_LIBRARY support on WindowsOswald Buddenhagen2013-03-143-15/+3
| | | | | | | | | | | | | | | | the exclusion came in with the original winCE port. the reason for this is not clear. Change-Id: I8cd59d27fcc292186e5eef3238f56bad2cf320c1 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
| * Make sure that the reference count for plugins is kept correctlyThiago Macieira2013-02-272-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For systems where the Unix signature checker isn't enabled (read: Mac and Windows), QPluginLoader must actually load the plugin to query for the metadata. On Mac it even tried to keep the library loaded to avoid unloading and reloading again when the user calls load(). However, that plus the fact that it was calling load_sys() (on Mac) meant that it would bypass the reference count checking. And on all Unix, if a library-that-wasnt-a-plugin was already loaded by way of a QLibrary, it would have an effect of unloading said library. So remove the "caching" of the library. We should instead invest time to write a proper Mach-O binary decoder. Task-number: QTBUG-29776 Change-Id: Iebbddabe60047aafedeced21f26a170f59656757 Reviewed-by: Liang Qi <liang.qi@digia.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
| * Don't try to unload a library that isn't loadedThiago Macieira2013-02-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Both QPluginLoader::unload() and QLibrary::unload() protect against that (they have a "did_load" member), but QFactoryLoaderPrivate's destructor doesn't. In the past (Qt4) all plugins had to be loaded anyway, so there was no mistake in the reference counting. With Qt 5, we don't load plugins unless they're actually used (in QFactoryLoader::instance). Task-number: QTBUG-29773 Change-Id: I3278fa14bac7e26a9faaf999b4e42e950654ac9a Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * Fix crash-on-exit with some plugin systems (e.g. sensors)Thiago Macieira2013-02-071-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't assume that all entries in the QLibrary global data refer to libraries have have been loaded. There are three (not two) ways of getting entries there: 1) creating a QLibrary 2) using the static QLibrary::resolve 3) via plugins The unload code was meant to handle the first two cases only: libraries are still loaded at the end of the execution if the static methods were called or if QLibrary objects were leaked. It didn't handle the case of plugins being found by the directory scanner in QFactoryLoader but never loaded. Note it's possible that this assertion also happened with leaked QLibrary. Change-Id: Idcd7a551f96d8fe500cbca682f8014f5122b7584 Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * Work around an unfixed glibc bug in dlclose(3) on exitThiago Macieira2013-02-022-4/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During exit, libraries are unloaded and global destructors are run. If we call dlclose(3) from inside the global destructors, we might be telling libdl to unload a module it has already unloaded. I cannot reproduce the issue on my Fedora 17 machine with glibc 2.15, but it could be reliably be reproduced on an Ubuntu 11.10. The assertion is identical to the one reported upstream at http://sourceware.org/bugzilla/show_bug.cgi?id=11941 (see better explanation at https://bugzilla.novell.com/show_bug.cgi?id=622977). I cannot find any evidence in glibc's source code that the bug has been fixed. Change-Id: I97745f89e8c5481196e645dada8762d607a9fb2c Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * Improve QLibrary global destructionThiago Macieira2013-02-022-39/+111
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous solution was a global static, which got deleted at the end of the execution of the application or at QtCore unload, whichever came first. Unfortunately, the end of the execution often came first, which is inconvenient: it means the global was deleted before all atexit functions were run, including some QLibrary destructors. Consequently, some QLibrary destructors did not reach the global data and were thus unable to unload their libraries or delete their data properly. The previous solution leaked. This solution instead uses a Q_DESTRUCTOR_FUNCTION, which makes a requirement to destroy only at QtCore unload time. Thus, we're sure that all references have been dropped. Additionally, during the cleanup, do try to unload the libraries that have a single reference count left. That means either a QLibrary that was destroyed without unload(), or a use of the static QLibrary::resolve functions. Change-Id: I12e0943b0c6edc27390c103b368d1b04bfe7e302 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * Remove QT_{BEGIN,END}_HEADER macro usageSergio Ahumada2013-01-295-20/+0
| | | | | | | | | | | | | | | | | | | | | | The macro was made empty in ba3dc5f3b56d1fab6fe37fe7ae08096d7dc68bcb and is no longer necessary or used. Discussed-on: http://lists.qt-project.org/pipermail/development/2013-January/009284.html Change-Id: Id2bb2e2cabde059305d4af5f12593344ba30f001 Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com> Reviewed-by: hjk <hjk121@nokiamail.com>
| * Merge "Merge remote-tracking branch 'origin/stable' into dev" into ↵Frederik Gladhorn2013-01-2318-18/+18
| |\ | | | | | | | | | refs/staging/dev
| * | Do not define QT_NO_DYNAMIC_LIBRARY for VxWorks process (RTP)Pasi Petäjäjärvi2013-01-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Shared libraries cannot be used in kernel mode (DKM), only at process mode (RTP). Change-Id: I8cecc12461aa4417b16577db3bc9cd85a1aa7efa Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* | | Doc: corrected snippet statement in qplugin.qdocNico Vertriest2013-03-141-1/+1
| |/ |/| | | | | | | | | | | | | Corrected path for snippet with Q_DECLARE_INTERFACE Task-number: QTBUG-29101 Change-Id: I910bb339a4ec6ecf2ad1ea76eaaa73114ab65a68 Reviewed-by: Martin Smith <martin.smith@digia.com>
* | Update copyright year in Digia's license headersSergio Ahumada2013-01-1818-18/+18
|/ | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>