diff options
author | Ahmad Samir <a.samirh78@gmail.com> | 2023-02-27 13:11:35 +0200 |
---|---|---|
committer | Ahmad Samir <a.samirh78@gmail.com> | 2023-07-19 19:40:51 +0300 |
commit | 619b03401d54e6334dfd04ead6439134c88ec71b (patch) | |
tree | 743d8dcc32424e40a2ebf0c7bb15ab2c019b36a9 /src/corelib/kernel/qeventdispatcher_glib.cpp | |
parent | 74422bbf0256861899b73de908b45b1a8c8f1aae (diff) |
QTimerInfoList: don't inherit from a container in an exported class
Instead use composition by using a container member; inheriting from
containers has a couple of issues:
- containers (STL and Qt) don't have virtual destructors, which means
that deleting via a pointer to the base-class would be troublesome
- as it turns out, inheriting from containers, QList in this case,
in an exported derived-class could lead to binary-incompatibility
issues (see linked bug report)
Drive-by change:
- group all private members in one place
- make timerInsert() private, nothing should use it from outside the
class anyway
Change-Id: I69843835d8c854fa4b13e8b4ba3fb69f1484f6a6
Fixes: QTBUG-111959
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/kernel/qeventdispatcher_glib.cpp')
-rw-r--r-- | src/corelib/kernel/qeventdispatcher_glib.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/kernel/qeventdispatcher_glib.cpp b/src/corelib/kernel/qeventdispatcher_glib.cpp index 58a9dc5e49..1e2777b08b 100644 --- a/src/corelib/kernel/qeventdispatcher_glib.cpp +++ b/src/corelib/kernel/qeventdispatcher_glib.cpp @@ -335,7 +335,7 @@ QEventDispatcherGlib::~QEventDispatcherGlib() Q_D(QEventDispatcherGlib); // destroy all timer sources - qDeleteAll(d->timerSource->timerList); + d->timerSource->timerList.clearTimers(); d->timerSource->timerList.~QTimerInfoList(); g_source_destroy(&d->timerSource->source); g_source_unref(&d->timerSource->source); |