diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2019-05-24 22:06:09 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2019-08-20 17:36:04 +0200 |
commit | f556505f63a4255b681ba8a32e1f29ccb79725ce (patch) | |
tree | 6587436330c3e8eda6960689b6a31406f27009a4 /src/widgets/kernel/qwidget_p.h | |
parent | 9e86fdb6e8004a0eba7d5f4b9a7b1f52275fd207 (diff) |
QWidget: replace manual memory management with unique_ptr [6/N]: extra
Had to port a lot of caching temporaries, too. Decided to leave them as
crefs to unique_ptr to catch any mischief users may be doing with the
raw pointer instead (like deleting it).
Also fixed a use of 0 as nullptr (by standardizing on pointer-to-bool
conversion, as is done everywhere else in qwidget.cpp), and made one
impregnable if condition readable.
Change-Id: Ifdc240bf352c52de0bc3c186fa7a5f4cb2882dd0
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/widgets/kernel/qwidget_p.h')
-rw-r--r-- | src/widgets/kernel/qwidget_p.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/widgets/kernel/qwidget_p.h b/src/widgets/kernel/qwidget_p.h index b4a9d283db..687e8bef09 100644 --- a/src/widgets/kernel/qwidget_p.h +++ b/src/widgets/kernel/qwidget_p.h @@ -669,7 +669,7 @@ public: // Variables. // Regular pointers (keep them together to avoid gaps on 64 bit architectures). - QWExtra *extra; + std::unique_ptr<QWExtra> extra; QWidget *focus_next; QWidget *focus_prev; QWidget *focus_child; @@ -945,7 +945,7 @@ public: inline QWExtra *QWidgetPrivate::extraData() const { - return extra; + return extra.get(); } inline QTLWExtra *QWidgetPrivate::topData() const |