From 133e40283155852585b5fc409909a00e920cfcfc Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Mon, 1 Jun 2015 00:22:35 +0200 Subject: De-duplicate vtables, part I: exported private classes By making the destructor (usually the first non-inline, non-pure, virtual function, and therefore the trigger for most compilers to emit the vtable and type_info structures for the class in that TU) out-of-line, vtables and, more importantly, type_info structures for the class are pinned to a single TU. This prevents false negative dynamic_cast and catch evaluation. In this first batch, we de-inline destructors of exported private classes. Since they are already exported, users of these classes are unaffected by the change, and since it's private API, we don't need to avoid adding code to the out-of-line destructor until Qt 6. Change-Id: I450707877d2cb6a77f79ae1dd355facb98d6c517 Reported-by: Volker Krause Task-number: QTBUG-45582 Reviewed-by: Oswald Buddenhagen Reviewed-by: Friedemann Kleint Reviewed-by: Lars Knoll Reviewed-by: Konstantin Ritt Reviewed-by: Thiago Macieira --- src/widgets/graphicsview/qgraphicsview_p.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/widgets/graphicsview/qgraphicsview_p.h') diff --git a/src/widgets/graphicsview/qgraphicsview_p.h b/src/widgets/graphicsview/qgraphicsview_p.h index fec8336695..dcbffb1c39 100644 --- a/src/widgets/graphicsview/qgraphicsview_p.h +++ b/src/widgets/graphicsview/qgraphicsview_p.h @@ -63,6 +63,7 @@ class Q_WIDGETS_EXPORT QGraphicsViewPrivate : public QAbstractScrollAreaPrivate Q_DECLARE_PUBLIC(QGraphicsView) public: QGraphicsViewPrivate(); + ~QGraphicsViewPrivate(); void recalculateContentSize(); void centerView(QGraphicsView::ViewportAnchor anchor); -- cgit v1.2.3